mirror of
https://github.com/Hopiu/django-markdownx.git
synced 2026-05-04 19:44:42 +00:00
Allow to paste tabs using Tab button
This commit is contained in:
parent
bcfa38b593
commit
884d66cc16
3 changed files with 21 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
4
setup.py
4
setup.py
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue