X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-bootstrap-debug.js;h=87455f01732325aeed95ba567d3cca66eb2386ac;hb=refs%2Fheads%2Fwip_leon_T7605_revamp_image_managment_code;hp=8bb19c0b77a0a446cb1b2904dbbcdaf0d30688e9;hpb=3a504c825377f9ee2c842d074a0a4e6b31ea5172;p=roojs1 diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 8bb19c0b77..87455f0173 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -389,14 +389,11 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { { var cn = this; - Roo.log('ADDXTYPE'); cn = Roo.factory(tree); //Roo.log(['addxtype', cn]); cn.parentType = this.xtype; //?? cn.parentId = this.id; - - Roo.log(cn.el); cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr; if (typeof(cn.container_method) == 'string') { @@ -465,7 +462,6 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { addxtypeChild : function (tree, cntr, is_body) { Roo.debug && Roo.log('addxtypeChild:' + cntr); - Roo.log('ADDXTYPECHILD'); var cn = this; cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr; @@ -486,7 +482,6 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { } cn = Roo.factory(tree); - Roo.log(cn.el); cn.parentType = this.xtype; //?? cn.parentId = this.id; @@ -518,7 +513,6 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { cn.el = echild; - Roo.log(cn.el); // Roo.log("GOT"); //echild.dom.removeAttribute('xtype'); } else { @@ -586,7 +580,7 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { if (!skip_children) { for(var i =0;i < items.length;i++) { // Roo.log(['add child', items[i]]); - nitems.push(cn.addxtype(Roo.apply({}, items[i]))); + nitems.push(cn.addxtype(items[i].xns == false ? items[i] : Roo.apply({}, items[i]))); } } @@ -32587,6 +32581,7 @@ Roo.bootstrap.form.HtmlEditor = function(config){ * Fires when on any editor when an image is deleted * @param {Roo.bootstrap.form.HtmlEditor} this * @param {HTMLElement} img could also be a figure if blocks are enabled + * @param {HTMLElement} oldSrc source of image being replaced */ imagedelete: true }); @@ -33172,12 +33167,13 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp var reader = new FileReader(); reader.addEventListener('load', (function() { if (bl) { + var oldSrc = bl.image_src; bl.image_src = reader.result; //bl.caption = f.name; bl.updateElement(sn); this.editor.syncValue(); editor.owner.fireEvent('editorevent', editor.owner, false); - editor.owner.fireEvent('imageupdate', editor.owner, sn); + editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSrc); // we only do the first file!! and replace. return; } @@ -33193,10 +33189,11 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp } // just a standard img.. if (sn && sn.tagName.toUpperCase() == 'IMG') { + var oldSrc = sn.src; sn.src = reader.result; this.editor.syncValue(); editor.owner.fireEvent('editorevent', editor.owner, false); - editor.owner.fireEvent('imageupdate', editor.owner, sn); + editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSrc); return; } editor.insertAtCursor('');