From: Alan Knowles Date: Tue, 5 Jan 2021 09:22:10 +0000 (+0800) Subject: roojs-bootstrap.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=8b00bb04e2ae896cc194e74f222c68405ee7e438 roojs-bootstrap.js roojs-bootstrap-debug.js Roo/bootstrap/Markdown.js --- diff --git a/Roo/bootstrap/Markdown.js b/Roo/bootstrap/Markdown.js index bf07dd7f6a..3f4a390b27 100644 --- a/Roo/bootstrap/Markdown.js +++ b/Roo/bootstrap/Markdown.js @@ -30,11 +30,8 @@ Roo.extend(Roo.bootstrap.Markdown, Roo.bootstrap.TextArea, { cls : 'roo-markdown-area' }); this.inputEl().addClass('d-none'); - var v = this.getValue(); - if (v === false) { - v = ''; - } - this.markdownEl.dom.innerHTML = Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(v)); + + this.markdownEl.dom.innerHTML = Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue())); this.markdownEl.on('click', this.toggleTextEdit, this); this.on('blur', this.toggleTextEdit, this); this.on('specialkey', this.resizeTextArea, this); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 48c3b0b07e..d284920d4b 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -26142,11 +26142,8 @@ Roo.extend(Roo.bootstrap.Markdown, Roo.bootstrap.TextArea, { cls : 'roo-markdown-area' }); this.inputEl().addClass('d-none'); - var v = this.getValue(); - if (v === false) { - v = ''; - } - this.markdownEl.dom.innerHTML = Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(v)); + + this.markdownEl.dom.innerHTML = Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue())); this.markdownEl.on('click', this.toggleTextEdit, this); this.on('blur', this.toggleTextEdit, this); this.on('specialkey', this.resizeTextArea, this); @@ -26177,11 +26174,8 @@ Roo.extend(Roo.bootstrap.Markdown, Roo.bootstrap.TextArea, { this.markdownEl.dom.innerHTML = String.format('{0}', this.placeholder || ''); return; } - var v = this.getValue(); - if (v === false) { - v = ''; - } - this.markdownEl.dom.innerHTML = Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(v)); + + this.markdownEl.dom.innerHTML = Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue())); }, resizeTextArea: function () { diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 3b9941fc75..2515c984d4 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1095,10 +1095,10 @@ A.get('align-center').setActive(B.queryCommandState('justifycenter'));A.get('ali this.editor.toggleSourceEdit(A);}}); // Roo/bootstrap/Markdown.js Roo.bootstrap.Markdown=function(A){Roo.bootstrap.Markdown.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Markdown,Roo.bootstrap.TextArea,{editing:false,initEvents:function(){Roo.bootstrap.TextArea.prototype.initEvents.call(this);this.markdownEl=this.el.createChild({cls:'roo-markdown-area'} -);this.inputEl().addClass('d-none');var v=this.getValue();if(v===false){v='';}this.markdownEl.dom.innerHTML=Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(v));this.markdownEl.on('click',this.toggleTextEdit,this);this.on('blur',this.toggleTextEdit,this);this.on('specialkey',this.resizeTextArea,this); +);this.inputEl().addClass('d-none');this.markdownEl.dom.innerHTML=Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue()));this.markdownEl.on('click',this.toggleTextEdit,this);this.on('blur',this.toggleTextEdit,this);this.on('specialkey',this.resizeTextArea,this); },toggleTextEdit:function(){var sh=this.markdownEl.getHeight();this.inputEl().addClass('d-none');this.markdownEl.addClass('d-none');if(!this.editing){this.inputEl().setHeight(Math.min(500,Math.max(sh,(this.getValue().split("\n").length+1)*30)));this.inputEl().removeClass('d-none'); this.inputEl().focus();this.editing=true;return;}this.updateMarkdown();this.markdownEl.removeClass('d-none');this.editing=false;return;},updateMarkdown:function(){if(this.getValue()==''){this.markdownEl.dom.innerHTML=String.format('{0}',this.placeholder||''); -return;}var v=this.getValue();if(v===false){v='';}this.markdownEl.dom.innerHTML=Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(v));},resizeTextArea:function(){var sh=100;Roo.log([sh,this.getValue().split("\n").length*30]);this.inputEl().setHeight(Math.min(500,Math.max(sh,(this.getValue().split("\n").length+1)*30))); +return;}this.markdownEl.dom.innerHTML=Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue()));},resizeTextArea:function(){var sh=100;Roo.log([sh,this.getValue().split("\n").length*30]);this.inputEl().setHeight(Math.min(500,Math.max(sh,(this.getValue().split("\n").length+1)*30))); },setValue:function(A){Roo.bootstrap.TextArea.prototype.setValue.call(this,A);if(!this.editing){this.updateMarkdown();}},focus:function(){if(!this.editing){this.toggleTextEdit();}}}); // Roo/bootstrap/Table/AbstractSelectionModel.js Roo.bootstrap.Table.AbstractSelectionModel=function(){this.locked=false;Roo.bootstrap.Table.AbstractSelectionModel.superclass.constructor.call(this);};Roo.extend(Roo.bootstrap.Table.AbstractSelectionModel,Roo.util.Observable,{init:function(A){this.grid=A;this.initEvents();