From 46ec335c42e4c609aa5abcfe84a4d0591b2608d3 Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 17 Oct 2019 10:31:57 -0600 Subject: [PATCH] Add attribute to turn off double click to edit editable widget --- api/js/etemplate/et2_core_editableWidget.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_core_editableWidget.js b/api/js/etemplate/et2_core_editableWidget.js index 6709473546..7b5315c097 100644 --- a/api/js/etemplate/et2_core_editableWidget.js +++ b/api/js/etemplate/et2_core_editableWidget.js @@ -30,6 +30,12 @@ var et2_editableWidget = (function(){ "use strict"; return et2_inputWidget.exten default: false, description: "If set to 'editable' will start readonly, double clicking will make it editable and clicking out will save" }, + toggle_readonly: { + name: "toggle_readonly", + type: "boolean", + default: true, + description: "Double clicking makes widget editable. If off, must be made editable in some other way." + }, save_callback: { name: "save_callback", type: "string", @@ -59,7 +65,7 @@ var et2_editableWidget = (function(){ "use strict"; return et2_inputWidget.exten if(_attrs.readonly && typeof _attrs.readonly === 'string') { _attrs.readonly = true; - this._toggle_readonly = true; + this._toggle_readonly = _attrs.toggle_readonly; } this._super.apply(this, arguments); },