textmodule: remove open and close delay

This commit is contained in:
Felix Niklas 2016-02-02 16:18:20 +01:00
parent 62549a2d2d
commit 031f60d3aa

View file

@ -187,21 +187,13 @@
}).on('focus', function (e) { }).on('focus', function (e) {
_this.close() _this.close()
}).on('blur', function (e) {
// delay, to get click on text module before widget is closed
a = $.proxy(function() {
this.close()
}, _this)
setTimeout(a, 600);
}) })
}; };
// create base template // create base template
Plugin.prototype.baseTemplate = function() { Plugin.prototype.baseTemplate = function() {
this.$element.after('<div class="shortcut dropdown"><ul class="dropdown-menu" style="max-height: 200px;"><li><a>-</a></li></ul></div>') this.$element.after('<div class="shortcut dropdown"><ul class="dropdown-menu" style="max-height: 200px;"><li><a>-</a></li></ul></div>')
this.$widget = this.$element.next() this.$widget = this.$element.next()
console.log("element", this.$element);
} }
// set height of widget // set height of widget
@ -246,10 +238,8 @@
Plugin.prototype.open = function() { Plugin.prototype.open = function() {
this.active = true this.active = true
this.updatePosition() this.updatePosition()
b = $.proxy(function() {
this.$widget.addClass('open') this.$widget.addClass('open')
}, this) $(window).on('click.textmodule', $.proxy(this.close, this))
setTimeout(b, 400);
} }
// close widget // close widget
@ -260,6 +250,7 @@
} }
this.buffer = '' this.buffer = ''
this.active = false this.active = false
$(window).off('click.textmodule')
} }
// check if widget is active/open // check if widget is active/open