From 150fb13581bb14dc8e9b621757b25cd17206b74c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 25 Jun 2013 20:40:28 +0200 Subject: [PATCH] Added ability to double click on WCF.InlineEditor instances --- wcfsetup/install/files/js/WCF.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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'); -- 2.20.1