Improved inline editor to support non-editable posts
authorAlexander Ebert <ebert@woltlab.com>
Tue, 18 Jun 2013 14:57:36 +0000 (16:57 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 18 Jun 2013 14:57:36 +0000 (16:57 +0200)
wcfsetup/install/files/js/WCF.Message.js

index 85d8f05d8a4e94ca2d53ba54b60fcd1959a3e492..f95e26ceae8a22d95650223af7aafe5ac40c12bf 100644 (file)
@@ -1107,7 +1107,8 @@ WCF.Message.InlineEditor = Class.extend({
                                this._container[$containerID] = $container;
                                
                                if ($container.data('canEditInline')) {
-                                       $container.find('.jsMessageEditButton:eq(0)').data('containerID', $containerID).click($.proxy(this._clickInline, this)).dblclick($.proxy(this._click, this));
+                                       var $button = $container.find('.jsMessageEditButton:eq(0)').data('containerID', $containerID).click($.proxy(this._clickInline, this));
+                                       if ($container.data('canEdit')) $button.dblclick($.proxy(this._click, this));
                                }
                                else if ($container.data('canEdit')) {
                                        $container.find('.jsMessageEditButton:eq(0)').data('containerID', $containerID).click($.proxy(this._click, this));