From: Alexander Ebert Date: Tue, 25 Jun 2013 18:40:28 +0000 (+0200) Subject: Added ability to double click on WCF.InlineEditor instances X-Git-Tag: 2.0.0_Beta_5~131 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=150fb13581bb14dc8e9b621757b25cd17206b74c;p=GitHub%2FWoltLab%2FWCF.git Added ability to double click on WCF.InlineEditor instances --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index b5862ab440..6bc0e08ede 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -6193,6 +6193,15 @@ WCF.InlineEditor = Class.extend({ return; } + this._setOptions(); + var $quickOption = ''; + for (var $i = 0, $length = this._options.length; $i < $length; $i++) { + if (this._options[$i].isQuickOption) { + $quickOption = this._options[$i].optionName; + break; + } + } + var self = this; $elements.each(function(index, element) { var $element = $(element); @@ -6205,6 +6214,10 @@ WCF.InlineEditor = Class.extend({ } $trigger.click($.proxy(self._show, self)).data('elementID', $elementID); + if ($quickOption) { + // simulate click on target action + $trigger.disableSelection().data('optionName', $quickOption).dblclick($.proxy(self._click, self)); + } // store reference self._elements[$elementID] = $element; @@ -6214,8 +6227,6 @@ WCF.InlineEditor = Class.extend({ success: $.proxy(this._success, this) }); - this._setOptions(); - WCF.CloseOverlayHandler.addCallback('WCF.InlineEditor', $.proxy(this._closeAll, this)); this._notification = new WCF.System.Notification(WCF.Language.get('wcf.global.success'), 'success');