Allow to paste tabs using Tab button

This commit is contained in:
Adrian 2014-11-05 23:11:33 +01:00
parent bcfa38b593
commit 884d66cc16
3 changed files with 21 additions and 2 deletions

View file

@ -130,6 +130,10 @@ It is easy customizable, i.e. when you want to use Bootstrap 3 and "real" side-b
# Changelog
### v0.2.0
* Allow to paste tabs using Tab button
### v0.1.4
* package data fix

View file

@ -92,6 +92,21 @@ $.fn.extend({
update();
});
$markdownx_editor.on('keydown', function(e) {
if (e.keyCode === 9) {
var start = this.selectionStart;
var end = this.selectionEnd;
var $this = $(this);
var value = $this.val();
$this.val(value.substring(0, start) + "\t" + value.substring(end));
this.selectionStart = this.selectionEnd = start + 1;
return false;
}
});
$markdownx_editor.on('dragenter dragover', function(e) {
e.originalEvent.dataTransfer.dropEffect= 'copy';

View file

@ -6,7 +6,7 @@ if 'vagrant' in str(os.environ):
setup(
name='django-markdownx',
version='0.1.4',
version='0.2.0',
packages=find_packages(),
include_package_data=True,
description='Simple markdown editor (with live preview and images uploads) built for Django',
@ -15,7 +15,7 @@ setup(
author_email='adrian@enove.pl',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',