ActionsEditor.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. MWF.xApplication.process = MWF.xApplication.process || {};
  2. MWF.xApplication.process.FormDesigner = MWF.xApplication.process.FormDesigner || {};
  3. MWF.xApplication.process.FormDesigner.widget = MWF.xApplication.process.FormDesigner.widget || {};
  4. MWF.require("MWF.widget.ScriptArea", null, false);
  5. MWF.require("MWF.widget.Maplist", null, false);
  6. MWF.xApplication.process.FormDesigner.widget.ActionsEditor = new Class({
  7. Implements: [Options, Events],
  8. Extends: MWF.widget.Common,
  9. options: {
  10. "style": "default",
  11. "maxObj": document.body,
  12. "isSystemTool" : false,
  13. "noCreate": false,
  14. "noDelete": false,
  15. "noCode": false,
  16. "noHide": false,
  17. "systemToolsAddress" : "../x_component_process_FormDesigner/Module/Actionbar/toolbars.json"
  18. },
  19. initialize: function(node, designer, module, options){
  20. this.setOptions(options);
  21. this.node = $(node);
  22. this.module = module;
  23. this.designer = designer;
  24. this.path = "../x_component_process_FormDesigner/widget/$ActionsEditor/";
  25. this.cssPath = "../x_component_process_FormDesigner/widget/$ActionsEditor/"+this.options.style+"/css.wcss";
  26. this._loadCss();
  27. this.actions = [];
  28. this.currentEditItem = null;
  29. this.createActionsAreaNode();
  30. },
  31. createActionsAreaNode: function(){
  32. this.actionsContainer = new Element("div", {
  33. "styles": this.css.actionsContainer
  34. }).inject(this.node);
  35. // var size = this.node.getUsefulSize();
  36. // this.eventsContainer.setStyle("height", size.y);
  37. },
  38. load: function(data){
  39. this.loadActionsArea();
  40. if (!this.options.noCreate) this.loadCreateActionButton();
  41. this.data = data;
  42. if ( !this.data || typeOf(this.data)!=="array") this.data = [];
  43. this.loadRestoreActionButton();
  44. this.data.each(function(actionData, idx){
  45. if (actionData.type!=="MWFToolBarSeparator"){
  46. var action = new MWF.xApplication.process.FormDesigner.widget.ActionsEditor.ButtonAction(this);
  47. action.load(actionData);
  48. this.actions.push(action);
  49. }
  50. }.bind(this));
  51. },
  52. loadActionsArea: function(){
  53. if (!this.options.noCreate){
  54. this.actionTitleArea = new Element("div", {
  55. "styles": this.css.actionTitleArea
  56. }).inject(this.actionsContainer);
  57. }
  58. this.actionArea = new Element("div", {
  59. "styles": this.css.actionArea
  60. }).inject(this.actionsContainer);
  61. },
  62. loadCreateActionButton: function(){
  63. this.createActionButtonButton = new Element("div", {
  64. "styles": this.css.createActionButton,
  65. "title" : this.designer.lp.actionbar.addCustomTool,
  66. "text": "+"
  67. }).inject(this.actionTitleArea);
  68. this.createActionButtonButton.addEvent("click", function(){
  69. this.addButtonAction();
  70. }.bind(this));
  71. },
  72. loadRestoreActionButton : function(){
  73. if( this.options.isSystemTool ){
  74. if( !this.actionTitleArea ){
  75. this.actionTitleArea = new Element("div", { "styles": this.css.actionTitleArea }).inject(this.actionArea,"before");
  76. }
  77. this.restoreActionButtonButton = new Element("div", {
  78. "styles": this.css.restoreActionButton,
  79. "title" : this.designer.lp.actionbar.restoreDefaultTool
  80. }).inject(this.actionTitleArea);
  81. this.restoreActionButtonButton.addEvent("click", function(){
  82. this.restoreButtonAction();
  83. }.bind(this));
  84. }
  85. },
  86. listRemovedSystemTool : function(){
  87. var list = [];
  88. if( !this.defaultTools ){
  89. MWF.getJSON( this.options.systemToolsAddress, function(tools){
  90. this.defaultTools = tools;
  91. if( this.options.target && this.options.target === "mobileForm" ){
  92. this.defaultTools.push({
  93. "type": "MWFToolBarButton",
  94. "img": "read.png",
  95. "title": this.designer.lp.actionbar.setReaded,
  96. "action": "readedWork",
  97. "text": this.designer.lp.actionbar.readed,
  98. "id": "action_readed",
  99. "control": "allowReadProcessing",
  100. "condition": "",
  101. "read": true
  102. });
  103. }
  104. }.bind(this), false);
  105. }
  106. this.defaultTools.each( function( tool ){
  107. var flag = true;
  108. for( var i=0; i<(this.data || []).length; i++ ){
  109. if( this.data[i].id === tool.id ){
  110. flag = false;
  111. break;
  112. }
  113. }
  114. if(flag)list.push(tool);
  115. }.bind(this));
  116. return list;
  117. },
  118. addButtonAction: function(){
  119. var o = {
  120. "type": "MWFToolBarButton",
  121. "img": "4.png",
  122. "title": "",
  123. "action": "",
  124. "text": "Unnamed",
  125. "actionScript" : "",
  126. "condition": "",
  127. "editShow": true,
  128. "readShow": true
  129. };
  130. var action = new MWF.xApplication.process.FormDesigner.widget.ActionsEditor.ButtonAction(this);
  131. action.load(o);
  132. this.data.push(o);
  133. this.actions.push(action);
  134. this.fireEvent("change", [{
  135. compareName: " [addAction]",
  136. force: true
  137. }]);
  138. },
  139. restoreButtonAction : function(){
  140. var list = this.listRemovedSystemTool();
  141. if( !list.length )return;
  142. var selectableItems = [];
  143. list.each( function(d){
  144. var title = "";
  145. if( d.text && this.designer.lp.actionBar ){
  146. title = this.designer.lp.actionBar[ d.text.split(".").getLast().replace("}}","") ] || "";
  147. title = title ? (" (" + title + ")") : "";
  148. }
  149. selectableItems.push( {
  150. name : d.text + title,
  151. id : d.id
  152. })
  153. }.bind(this));
  154. MWF.xDesktop.requireApp("Template", "Selector.Custom", null, false);
  155. var opt = {
  156. "count": 0,
  157. "title": this.designer.lp.actionbar.selectDefaultTool,
  158. "selectableItems" : selectableItems,
  159. "values": [],
  160. "onComplete": function( array ){
  161. if( !array || array.length === 0 )return;
  162. var actionNameList = [];
  163. array.each( function(tool){
  164. for( var i=0; i<list.length; i++ ){
  165. if( list[i].id === tool.data.id ){
  166. list[i].system = true;
  167. this.data.push( list[i] );
  168. actionNameList.push( list[i].action );
  169. var action = new MWF.xApplication.process.FormDesigner.widget.ActionsEditor.ButtonAction(this);
  170. action.load(list[i]);
  171. this.actions.push(action);
  172. break;
  173. }
  174. }
  175. }.bind(this));
  176. this.fireEvent("change", [{
  177. compareName: " [addSystemAction]:"+actionNameList,
  178. force: true
  179. }]);
  180. }.bind(this)
  181. };
  182. var selector = new MWF.xApplication.Template.Selector.Custom(this.options.maxObj, opt );
  183. selector.load();
  184. }
  185. });
  186. MWF.xApplication.process.FormDesigner.widget.ActionsEditor.ButtonAction = new Class({
  187. initialize: function (editor) {
  188. this.editor = editor;
  189. this.css = this.editor.css;
  190. this.container = this.editor.actionArea
  191. },
  192. load: function (data) {
  193. this.data = data;
  194. this.loadNode();
  195. var form = this.editor.designer.form || this.editor.designer.page || this.editor.designer.view;
  196. if (form && form.scriptDesigner){
  197. this.scriptItem = form.scriptDesigner.addScriptItem(this.data, "actionScript", this.editor.module, "action.tools", this.data.text);
  198. }
  199. var text = this.data.text;
  200. Object.defineProperty(this.data, "text", {
  201. configurable : true,
  202. enumerable : true,
  203. "get": function(){return text;},
  204. "set": function(v){
  205. if (this.scriptItem){
  206. this.scriptItem.par = v;
  207. this.scriptItem.resetText();
  208. }
  209. text = v;
  210. }.bind(this)
  211. });
  212. },
  213. loadNode: function () {
  214. this.node = new Element("div", {"styles": this.css.actionNode}).inject(this.container);
  215. this.titleNode = new Element("div", {"styles": this.css.actionTitleNode}).inject(this.node);
  216. this.iconNode = new Element("div", {"styles": this.css.actionIconNode}).inject(this.titleNode);
  217. this.textNode = new Element("div", {"styles": this.css.actionTextNode, "text": this.data.text}).inject(this.titleNode);
  218. if( this.data.text && this.editor.designer.lp.actionBar){
  219. var title = this.editor.designer.lp.actionBar[ this.data.text.split(".").getLast().replace("}}","") ] || "";
  220. this.textNode.set("title", title || "");
  221. }
  222. this.upButton = new Element("div", {"styles": this.css.actionUpButtonNode, "title": this.editor.designer.lp.actionbar.up}).inject(this.titleNode);
  223. this.propertiesButton = new Element("div", {"styles": this.css.actionPropertiesButtonNode, "title": this.editor.designer.lp.actionbar.property}).inject(this.titleNode);
  224. if (!this.data.properties || Object.keys(this.data.properties).length === 0 ){
  225. this.propertiesButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/property_empty.png)");
  226. }else{
  227. this.propertiesButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/property.png)");
  228. }
  229. this.propertiesNode = new Element("div", {"styles": this.css.actionScriptNode}).inject(this.node);
  230. this.propertiesArea = new MWF.widget.Maplist(this.propertiesNode, {
  231. "title": this.editor.designer.lp.actionbar.setProperties,
  232. "collapse": false,
  233. "onChange": function(){
  234. this.data.properties = this.propertiesArea.toJson();
  235. if (!this.data.properties || Object.keys(this.data.properties).length === 0 ){
  236. this.propertiesButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/property_empty.png)");
  237. }else{
  238. this.propertiesButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/property.png)");
  239. }
  240. this.editor.fireEvent("change", [{
  241. compareName: "."+this.getName() + ".property"
  242. }]);
  243. }.bind(this)
  244. });
  245. this.propertiesArea.load( this.data.properties || {});
  246. if (!this.editor.options.noDelete) this.delButton = new Element("div", {
  247. "styles": this.css.actionDelButtonNode,
  248. "text": "-",
  249. "title" : this.editor.designer.lp.actionbar.delete
  250. }).inject(this.titleNode);
  251. this.conditionButton = new Element("div", {"styles": this.css.actionConditionButtonNode, "title": this.editor.designer.lp.actionbar.hideCondition}).inject(this.titleNode);
  252. if (this.data.condition){
  253. this.conditionButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/code.png)");
  254. }else{
  255. this.conditionButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/code_empty.png)");
  256. }
  257. if (!this.editor.options.noEditShow && !this.data.system){
  258. this.editButton = new Element("div", {"styles": this.css.actionEditButtonNode, "title": this.editor.designer.lp.actionbar.edithide}).inject(this.titleNode);
  259. if (this.data.editShow){
  260. this.editButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/edit.png)");
  261. }else{
  262. this.editButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/edit_hide.png)");
  263. }
  264. }
  265. if (!this.editor.options.noReadShow && !this.data.system){
  266. this.readButton = new Element("div", {"styles": this.css.actionReadButtonNode, "title": this.editor.designer.lp.actionbar.readhide}).inject(this.titleNode);
  267. if (this.data.readShow){
  268. this.readButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/read.png)");
  269. }else{
  270. this.readButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/read_hide.png)");
  271. }
  272. }
  273. if (this.editor.options.iconType==='font'){
  274. this.iconNode.addClass("ooicon-"+this.data.icon);
  275. this.iconNode.setStyles({
  276. "display": "flex",
  277. "align-items": "center",
  278. "justify-content": "center"
  279. });
  280. }else{
  281. var icon = this.editor.path+this.editor.options.style+"/tools/"+this.data.img;
  282. this.iconNode.setStyle("background-image", "url("+icon+")");
  283. }
  284. if (!this.editor.options.noCode && !this.data.system ){
  285. this.scriptNode = new Element("div", {"styles": this.css.actionScriptNode}).inject(this.node);
  286. this.scriptArea = new MWF.widget.ScriptArea(this.scriptNode, {
  287. "title": this.editor.designer.lp.actionbar.editScript,
  288. "isbind": false,
  289. "maxObj": this.editor.options.scriptMaxObj || this.editor.designer.formContentNode,
  290. "key": "actionScript",
  291. "onChange": function(){
  292. this.data.actionScript = this.scriptArea.editor.getValue();
  293. this.editor.fireEvent("change", [{
  294. compareName: "."+this.getName() + ".actionScript"
  295. }]);
  296. }.bind(this),
  297. "onSave": function(){
  298. this.data.actionScript = this.scriptArea.editor.getValue();
  299. this.editor.fireEvent("change", [{
  300. compareName: "."+this.getName() + ".actionScript"
  301. }]);
  302. this.editor.designer.saveForm();
  303. }.bind(this),
  304. "onPostLoad": function(){
  305. // this.scriptNode.setStyle("display", "none");
  306. }.bind(this)
  307. });
  308. this.scriptArea.load({"code": this.data.actionScript});
  309. }
  310. this.conditionNode = new Element("div", {"styles": this.css.actionScriptNode}).inject(this.node);
  311. this.conditionArea = new MWF.widget.ScriptArea(this.conditionNode, {
  312. "title": this.editor.designer.lp.actionbar.editCondition,
  313. "isbind": false,
  314. "maxObj": this.editor.options.scriptMaxObj || this.editor.designer.formContentNode,
  315. "onChange": function(){
  316. this.data.condition = this.conditionArea.editor.getValue();
  317. if (this.data.condition){
  318. this.conditionButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/code.png)");
  319. }else{
  320. this.conditionButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/code_empty.png)");
  321. }
  322. this.editor.fireEvent("change", [{
  323. compareName: "."+this.getName() + ".conditionScript"
  324. }]);
  325. }.bind(this),
  326. "onSave": function(){
  327. this.data.condition = this.conditionArea.editor.getValue();
  328. this.editor.fireEvent("change", [{
  329. compareName: "."+this.getName() + ".conditionScript"
  330. }]);
  331. this.editor.designer.saveForm();
  332. }.bind(this),
  333. "onPostLoad": function(){
  334. // this.conditionNode.setStyle("display", "none");
  335. }.bind(this)
  336. });
  337. this.conditionArea.load({"code": this.data.condition});
  338. this.setEvent();
  339. //this.loadEditNode();
  340. //this.loadChildNode();
  341. //this.setTitleNode();
  342. //this.setEditNode();
  343. },
  344. getName: function(){
  345. return this.data.action || this.data.text;
  346. },
  347. setEvent: function(){
  348. this.iconMenu = new MWF.widget.Menu(this.iconNode, {
  349. "event": "click",
  350. "style": "actionbarIcon",
  351. "onPostShow" : function (ev) {
  352. ev.stopPropagation();
  353. }
  354. });
  355. this.iconMenu.load();
  356. var _self = this;
  357. if (this.editor.options.iconType==='font'){
  358. o2.JSON.get("/x_desktop/css/v10/ooicon.json", function(json){
  359. const icons = json.glyphs;
  360. icons.forEach(function(i){
  361. var item = this.iconMenu.addMenuItem("", "click", function(ev){
  362. var icon = this.item.iconName;
  363. _self.iconNode.set("class", "ooicon-"+icon);
  364. _self.data.icon = icon;
  365. _self.editor.fireEvent("change", [{
  366. compareName: "."+icon + ".icon"
  367. }]);
  368. ev.stopPropagation();
  369. });
  370. item.item.addClass("ooicon-"+i.font_class);
  371. item.item.setStyles({
  372. "text-align": "center",
  373. "line-height": "28px",
  374. "font-size": "14px"
  375. });
  376. item.item.iconName = i.font_class;
  377. }.bind(this));
  378. }.bind(this));
  379. }else{
  380. for (var i=1; i<=136; i++){
  381. var icon = this.editor.path+this.editor.options.style+"/tools/"+i+".png";
  382. var item = this.iconMenu.addMenuItem("", "click", function(ev){
  383. var src = this.item.getElement("img").get("src");
  384. _self.data.img = src.substr(src.lastIndexOf("/")+1, src.length);
  385. _self.data.customImg = true;
  386. _self.iconNode.setStyle("background-image", "url("+src+")");
  387. _self.editor.fireEvent("change", [{
  388. compareName: "."+_self.getName() + ".img"
  389. }]);
  390. ev.stopPropagation();
  391. }, icon);
  392. item.iconName = i+".png";
  393. }
  394. }
  395. this.upButton.addEvent("click", function(e){
  396. var actions = this.editor.actions;
  397. var dataList = this.editor.data;
  398. var dataIndex = dataList.indexOf( this.data );
  399. var index = actions.indexOf( this );
  400. if( index === 0 || dataIndex === 0 ){
  401. e.stopPropagation();
  402. return;
  403. }
  404. var index_before = index-1;
  405. var action = actions[index_before];
  406. this.node.inject(action.node, "before");
  407. actions[index_before] = actions.splice(index, 1, actions[index_before])[0];
  408. this.editor.actions = actions;
  409. var dataIndex_before = dataIndex - 1;
  410. dataList[dataIndex_before] = dataList.splice(dataIndex, 1, dataList[dataIndex_before])[0];
  411. this.editor.data = dataList;
  412. this.editor.fireEvent("change", [{
  413. compareName: "."+this.getName() + " [up]"
  414. }]);
  415. e.stopPropagation();
  416. }.bind(this));
  417. this.propertiesButton.addEvent("click", function(e){
  418. var dis = this.propertiesNode.getStyle("display");
  419. if (dis=="none"){
  420. this.propertiesNode.setStyle("display", "block");
  421. }else{
  422. this.propertiesNode.setStyle("display", "none");
  423. }
  424. e.stopPropagation();
  425. }.bind(this));
  426. this.textNode.addEvent("click", function(e){
  427. this.textNode.empty();
  428. var editTitleNode = new Element("input", {"styles": this.css.actionEditTextNode, "type": "text", "value": this.data.text}).inject(this.textNode);
  429. editTitleNode.focus();
  430. editTitleNode.select();
  431. var _self = this;
  432. editTitleNode.addEvent("blur", function(){_self.editTitleComplete(this);});
  433. editTitleNode.addEvent("keydown:keys(enter)", function(){_self.editTitleComplete(this);});
  434. editTitleNode.addEvent("click", function(e){e.stopPropagation()});
  435. e.stopPropagation();
  436. }.bind(this));
  437. this.conditionButton.addEvent("click", function(e){
  438. e.stopPropagation();
  439. this.editCondition();
  440. }.bind(this));
  441. if (this.editButton) this.editButton.addEvent("click", function(e){
  442. if (this.data.editShow){
  443. this.editButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/edit_hide.png)");
  444. this.data.editShow = false;
  445. }else{
  446. this.editButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/edit.png)");
  447. this.data.editShow = true;
  448. }
  449. this.editor.fireEvent("change", [{
  450. compareName: "."+this.getName() + ".editShow"
  451. }]);
  452. e.stopPropagation();
  453. }.bind(this));
  454. if (this.readButton) this.readButton.addEvent("click", function(e){
  455. if (this.data.readShow){
  456. this.readButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/read_hide.png)");
  457. this.data.readShow = false;
  458. }else{
  459. this.readButton.setStyle("background-image", "url("+this.editor.path+this.editor.options.style+"/icon/read.png)");
  460. this.data.readShow = true;
  461. }
  462. this.editor.fireEvent("change", [{
  463. compareName: "."+this.getName() + ".readShow"
  464. }]);
  465. e.stopPropagation();
  466. }.bind(this));
  467. this.titleNode.addEvent("click", function(){
  468. if (this.scriptNode){
  469. var dis = this.scriptNode.getStyle("display");
  470. if (dis=="none"){
  471. this.scriptNode.setStyle("display", "block");
  472. if (this.scriptArea){
  473. this.scriptArea.resizeContentNodeSize();
  474. if (this.scriptArea.editor) this.scriptArea.editor.resize();
  475. if (!this.scriptArea.jsEditor){
  476. this.scriptArea.contentNode.empty();
  477. this.scriptArea.loadEditor({"code": this.data.actionScript});
  478. }
  479. }
  480. }else{
  481. this.scriptNode.setStyle("display", "none");
  482. }
  483. }
  484. }.bind(this));
  485. if (this.delButton) this.delButton.addEvent("click", function(e){
  486. var _self = this;
  487. this.editor.designer.confirm("warn", this.delButton, MWF.APPFD.LP.notice.deleteButtonTitle, MWF.APPFD.LP.notice.deleteButton, 300, 120, function(){
  488. _self.destroy();
  489. this.close();
  490. }, function(){
  491. this.close();
  492. }, null);
  493. e.stopPropagation();
  494. }.bind(this));
  495. },
  496. editCondition: function(){
  497. var dis = this.conditionNode.getStyle("display");
  498. if (dis=="none"){
  499. this.conditionNode.setStyle("display", "block");
  500. if (this.conditionArea){
  501. this.conditionArea.resizeContentNodeSize();
  502. if (this.conditionArea.editor) this.conditionArea.editor.resize();
  503. if (!this.conditionArea.jsEditor){
  504. this.conditionArea.contentNode.empty();
  505. this.conditionArea.loadEditor({"code": this.data.condition});
  506. }
  507. }
  508. }else{
  509. this.conditionNode.setStyle("display", "none");
  510. }
  511. },
  512. destroy: function(){
  513. var form = this.editor.designer.form || this.editor.designer.page || this.editor.designer.view;
  514. if ( form && form.scriptDesigner){
  515. form.scriptDesigner.deleteScriptItem(this.editor.module, "action.tools", this.data.text);
  516. }
  517. this.editor.data.erase(this.data);
  518. this.editor.actions.erase(this);
  519. this.editor.fireEvent("change", [{
  520. compareName: "."+this.getName() + " [delete]"
  521. }]);
  522. this.node.destroy();
  523. MWF.release(this.scriptArea);
  524. MWF.release(this);
  525. },
  526. editTitleComplete: function(el){
  527. this.data.text = el.get("value");
  528. this.data.title = el.get("value");
  529. el.destroy();
  530. this.textNode.empty();
  531. this.textNode.set("text", this.data.text);
  532. this.editor.fireEvent("change", [{
  533. compareName: "."+this.getName() + ".text"
  534. }]);
  535. }
  536. });