From: Alan Date: Fri, 6 Jan 2023 05:11:58 +0000 (+0800) Subject: support resize on bootstrap html editor X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=33e0a4a8b3d946e79df0554162e9b524db58a3b3 support resize on bootstrap html editor --- diff --git a/docs/json/roodata.json b/docs/json/roodata.json index 915b14de6e..5fd5698e10 100644 --- a/docs/json/roodata.json +++ b/docs/json/roodata.json @@ -24828,6 +24828,14 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "css", + "type" : "String", + "desc" : "styling for resizing. (used on bootstrap only)", + "memberOf" : "", + "isOptional" : false, + "optvals" : [] + }, { "name" : "disableClass", "type" : "String", @@ -24879,14 +24887,6 @@ "isOptional" : false, "optvals" : [] }, - { - "name" : "resizable", - "type" : "String", - "desc" : "'s' or 'se' or 'e' - wrapps the element in a\n Roo.resizable.", - "memberOf" : "", - "isOptional" : false, - "optvals" : [] - }, { "name" : "style", "type" : "String", @@ -134163,26 +134163,16 @@ "optvals" : [] }, { - "name" : "resizable", + "name" : "resize", "type" : "String", - "desc" : "'s' or 'se' or 'e' - wrapps the element in a\n Roo.resizable.", + "desc" : "l) - css resize of eleme", "memberOf" : "", "isOptional" : false, - "optvals" : [] - }, - { - "name" : "resize", - "type" : "string", - "desc" : "", - "memberOf" : "Roo.bootstrap.form.TextArea", - "isOptional" : false, "optvals" : [ "none", "both", "horizontal", - "vertical", - "inherit", - "initial" + "vertical" ] }, { @@ -158615,7 +158605,7 @@ { "name" : "minuteStep", "type" : "Number", - "desc" : "the minutes goes up/down by a fixed number, default 1", + "desc" : "the minutes is always the multiple of a fixed number, default 1", "memberOf" : "", "isOptional" : false, "optvals" : [] diff --git a/docs/src/Roo_HtmlEditorCore.js.html b/docs/src/Roo_HtmlEditorCore.js.html index 0a30e57f6e..289e026334 100644 --- a/docs/src/Roo_HtmlEditorCore.js.html +++ b/docs/src/Roo_HtmlEditorCore.js.html @@ -96,10 +96,9 @@ owner : false, /** - * @cfg {String} resizable 's' or 'se' or 'e' - wrapps the element in a - * Roo.resizable. + * @cfg {String} css styling for resizing. (used on bootstrap only) */ - resizable : false, + resize : false, /** * @cfg {Number} height (in pixels) */ @@ -232,17 +231,19 @@ this.frameId = Roo.id(); - - - var iframe = this.owner.wrap.createChild({ + var ifcfg = { tag: 'iframe', cls: 'form-control', // bootstrap.. id: this.frameId, name: this.frameId, frameBorder : 'no', 'src' : Roo.SSL_SECURE_URL ? Roo.SSL_SECURE_URL : "javascript:false" - }, this.el - ); + }; + if (this.resize) { + ifcfg.style = { resize : this.resize }; + } + + var iframe = this.owner.wrap.createChild(ifcfg, this.el); this.iframe = iframe.dom; diff --git a/docs/src/Roo_bootstrap_form_HtmlEditor.js.html b/docs/src/Roo_bootstrap_form_HtmlEditor.js.html index acd9f15b15..31bf14df95 100644 --- a/docs/src/Roo_bootstrap_form_HtmlEditor.js.html +++ b/docs/src/Roo_bootstrap_form_HtmlEditor.js.html @@ -115,10 +115,9 @@ btns : [], /** - * @cfg {String} resizable 's' or 'se' or 'e' - wrapps the element in a - * Roo.resizable. + * @cfg {String} resize (none|both|horizontal|vertical) - css resize of element */ - resizable : false, + resize : false, /** * @cfg {Number} height (in pixels) */ @@ -197,33 +196,11 @@ this.editorcore.onRender(ct, position); - if (this.resizable) { - this.resizeEl = new Roo.Resizable(this.wrap, { - pinned : true, - wrap: true, - dynamic : true, - minHeight : this.height, - height: this.height, - handles : this.resizable, - width: this.width, - listeners : { - resize : function(r, w, h) { - _t.onResize(w,h); // -something - } - } - }); - } this.createToolbar(this); - if(!this.width && this.resizable){ - this.setSize(this.wrap.getSize()); - } - if (this.resizeEl) { - this.resizeEl.resizeTo.defer(100, this.resizeEl,[ this.width,this.height ] ); - // should trigger onReize.. - } + }, @@ -294,9 +271,9 @@ //this.deferFocus(); } - if(this.resizable){ - this.setSize(this.wrap.getSize()); - } + //if(this.resizable){ + // this.setSize(this.wrap.getSize()); + //} this.fireEvent('editmodechange', this, this.editorcore.sourceEditMode); }, diff --git a/docs/src/Roo_bootstrap_form_TimeField.js.html b/docs/src/Roo_bootstrap_form_TimeField.js.html index a77240dc63..60bf02e0f0 100644 --- a/docs/src/Roo_bootstrap_form_TimeField.js.html +++ b/docs/src/Roo_bootstrap_form_TimeField.js.html @@ -9,7 +9,7 @@ * @class Roo.bootstrap.form.TimeField * @extends Roo.bootstrap.form.Input * Bootstrap DateField class - * @cfg {Number} minuteStep the minutes goes up/down by a fixed number, default 1 + * @cfg {Number} minuteStep the minutes is always the multiple of a fixed number, default 1 * * * @constructor @@ -433,14 +433,16 @@ onIncrementMinutes: function() { Roo.log('onIncrementMinutes'); - this.time = this.time.add(Date.MINUTE, this.minuteStep); + var minutesToAdd = Math.round((parseInt(this.time.format('i')) + this.minuteStep) / this.minuteStep) * this.minuteStep - parseInt(this.time.format('i')); + this.time = this.time.add(Date.MINUTE, minutesToAdd); this.update(); }, onDecrementMinutes: function() { Roo.log('onDecrementMinutes'); - this.time = this.time.add(Date.MINUTE, -1 * this.minuteStep); + var minutesToSubtract = parseInt(this.time.format('i')) - Math.round((parseInt(this.time.format('i')) - this.minuteStep) / this.minuteStep) * this.minuteStep; + this.time = this.time.add(Date.MINUTE, -1 * minutesToSubtract); this.update(); }, diff --git a/docs/symbols/Roo.HtmlEditorCore.json b/docs/symbols/Roo.HtmlEditorCore.json index e77b1f7a19..4a94ce1a0f 100644 --- a/docs/symbols/Roo.HtmlEditorCore.json +++ b/docs/symbols/Roo.HtmlEditorCore.json @@ -90,6 +90,14 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "css", + "type" : "String", + "desc" : "styling for resizing. (used on bootstrap only)", + "memberOf" : "", + "isOptional" : false, + "optvals" : [] + }, { "name" : "enableBlocks", "type" : "boolean", @@ -114,14 +122,6 @@ "isOptional" : false, "optvals" : [] }, - { - "name" : "resizable", - "type" : "String", - "desc" : "'s' or 'se' or 'e' - wrapps the element in a\n Roo.resizable.", - "memberOf" : "", - "isOptional" : false, - "optvals" : [] - }, { "name" : "height", "type" : "Number", diff --git a/docs/symbols/Roo.bootstrap.form.HtmlEditor.json b/docs/symbols/Roo.bootstrap.form.HtmlEditor.json index 78feb02f83..28629ac6fc 100644 --- a/docs/symbols/Roo.bootstrap.form.HtmlEditor.json +++ b/docs/symbols/Roo.bootstrap.form.HtmlEditor.json @@ -128,14 +128,6 @@ "isOptional" : false, "optvals" : [] }, - { - "name" : "resizable", - "type" : "String", - "desc" : "'s' or 'se' or 'e' - wrapps the element in a\n Roo.resizable.", - "memberOf" : "", - "isOptional" : false, - "optvals" : [] - }, { "name" : "toolbars", "type" : "Array", @@ -501,17 +493,15 @@ }, { "name" : "resize", - "type" : "string", - "desc" : "", - "memberOf" : "Roo.bootstrap.form.TextArea", + "type" : "String", + "desc" : "l) - css resize of eleme", + "memberOf" : "", "isOptional" : false, "optvals" : [ "none", "both", "horizontal", - "vertical", - "inherit", - "initial" + "vertical" ] }, { diff --git a/docs/symbols/Roo.bootstrap.form.TimeField.json b/docs/symbols/Roo.bootstrap.form.TimeField.json index 450403c9b4..a724926460 100644 --- a/docs/symbols/Roo.bootstrap.form.TimeField.json +++ b/docs/symbols/Roo.bootstrap.form.TimeField.json @@ -98,7 +98,7 @@ { "name" : "minuteStep", "type" : "Number", - "desc" : "the minutes goes up/down by a fixed number, default 1", + "desc" : "the minutes is always the multiple of a fixed number, default 1", "memberOf" : "", "isOptional" : false, "optvals" : []