diff --git a/src/ui/editorui.js b/src/ui/editorui.js index 75fa9e7..72dd97d 100644 --- a/src/ui/editorui.js +++ b/src/ui/editorui.js @@ -23,7 +23,7 @@ k = btnCmds.length; while (k --) { cmd = btnCmds[k]; - editorui[cmd] = function (cmd){ + editorui[cmd] = (function (cmd){ return function (editor, title){ title = title || defaultLabelMap[cmd.toLowerCase()] || ''; var ui = new editorui.Button({ @@ -45,7 +45,7 @@ }); return ui; }; - }(cmd); + })(cmd); } editorui.Justify = function (editor, side, title){ @@ -102,7 +102,7 @@ k = colorCmds.length; while (k --) { cmd = colorCmds[k]; - editorui[cmd] = function (cmd){ + editorui[cmd] = (function (cmd){ return function (editor, title){ title = title || defaultLabelMap[cmd.toLowerCase()] || ''; var ui = new editorui.ColorButton({ @@ -131,7 +131,7 @@ }); return ui; }; - }(cmd); + })(cmd); } //不需要确定取消按钮的dialog @@ -139,7 +139,7 @@ k = dialogNoButton.length; while(k --){ cmd = dialogNoButton[k]; - editorui[cmd] = function (cmd){ + editorui[cmd] = (function (cmd){ cmd = cmd.toLowerCase(); return function (editor, iframeUrl, title){ iframeUrl = iframeUrl || defaultIframeUrlMap[cmd.toLowerCase()] || 'about:blank'; @@ -179,14 +179,14 @@ }); return ui; }; - }(cmd); + })(cmd); } var dialogCmds = ['Link', 'Image', 'Map', 'Video']; k = dialogCmds.length; while (k --) { cmd = dialogCmds[k]; - editorui[cmd] = function (cmd){ + editorui[cmd] = (function (cmd){ cmd = cmd.toLowerCase(); return function (editor, iframeUrl, title){ iframeUrl = iframeUrl || defaultIframeUrlMap[cmd.toLowerCase()] || 'about:blank'; @@ -242,7 +242,7 @@ }); return ui; }; - }(cmd); + })(cmd); } var FONT_MAP = {