From e75a1060c107a4abf2c8bdb6b382e386aa1ea76b Mon Sep 17 00:00:00 2001 From: Romain Courteaud <romain@nexedi.com> Date: Wed, 20 Jan 2021 14:18:33 +0000 Subject: [PATCH] erp5_core: jslint on gadget editor --- .../erp5_core/gadget_editor.js.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_editor.js.js b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_editor.js.js index 9f43907475..1bac42cea0 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_editor.js.js +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_editor.js.js @@ -20,7 +20,7 @@ function readBlobAsDataURL(blob) { var fr = new FileReader(); - return new RSVP.Promise(function (resolve, reject, notify) { + return new RSVP.Promise(function (resolve, reject) { fr.addEventListener("load", resolve); fr.addEventListener("error", reject); fr.readAsDataURL(blob); @@ -70,20 +70,19 @@ .onStateChange(function (modification_dict) { var element = this.element, gadget = this, - url, div = document.createElement('div'), div_max = document.createElement('div'), queue = new RSVP.Queue(); if ((modification_dict.hasOwnProperty('editable')) || - (modification_dict.hasOwnProperty('editor')) || + (modification_dict.hasOwnProperty('editor')) || (gadget.state.editor === 'notebook_editor')) { // Clear first to DOM, append after to reduce flickering/manip while (element.firstChild) { element.removeChild(element.firstChild); } - if (modification_dict.hasOwnProperty('maximize') || - (gadget.state.editor === 'notebook_editor')) { + if (modification_dict.hasOwnProperty('maximize') || + (gadget.state.editor === 'notebook_editor')) { // for fck_editor fields, we want to be able to maximize also in non editable if ((gadget.state.maximize && gadget.state.editable) || (gadget.state.maximize && gadget.state.editor === 'jsmd_editor') || @@ -118,14 +117,14 @@ (gadget.state.editor === 'pdf')) { queue .push(function () { - var url = editor_dict[gadget.state.editor].url; + var gadget_url = editor_dict[gadget.state.editor].url; if (gadget.state.editor === 'jsmd_editor' && - !gadget.state.run && - gadget.state.editable) { - url = editor_dict.codemirror.url; + !gadget.state.run && + gadget.state.editable) { + gadget_url = editor_dict.codemirror.url; } return gadget.declareGadget( - url, + gadget_url, { scope: 'editor', sandbox: 'iframe', @@ -207,7 +206,8 @@ return result; }); */ - } else if (this.state.editable && + } + if (this.state.editable && (this.state.editor === 'text_area')) { result = {}; result[this.state.key] = this.element.querySelector('textarea').value; -- 2.30.9