v1.0
只读模式 group, 分享 评论更多问题 博客标签总是存在一个
This commit is contained in:
37
public/tinymce/classes/WindowManager.js
Normal file → Executable file
37
public/tinymce/classes/WindowManager.js
Normal file → Executable file
@ -49,6 +49,14 @@ define("tinymce/WindowManager", [
|
||||
|
||||
self.windows = windows;
|
||||
|
||||
editor.on('remove', function() {
|
||||
var i = windows.length;
|
||||
|
||||
while (i--) {
|
||||
windows[i].close();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Opens a new window.
|
||||
*
|
||||
@ -58,15 +66,13 @@ define("tinymce/WindowManager", [
|
||||
* @option {String} file URL of the file to open in the window.
|
||||
* @option {Number} width Width in pixels.
|
||||
* @option {Number} height Height in pixels.
|
||||
* @option {Boolean} resizable Specifies whether the popup window is resizable or not.
|
||||
* @option {Boolean} maximizable Specifies whether the popup window has a "maximize" button and can get maximized or not.
|
||||
* @option {String/bool} scrollbars Specifies whether the popup window can have scrollbars if required (i.e. content
|
||||
* @option {Boolean} autoScroll Specifies whether the popup window can have scrollbars if required (i.e. content
|
||||
* larger than the popup size specified).
|
||||
*/
|
||||
self.open = function(args, params) {
|
||||
var win;
|
||||
|
||||
editor.editorManager.activeEditor = editor;
|
||||
editor.editorManager.setActive(editor);
|
||||
|
||||
args.title = args.title || ' ';
|
||||
|
||||
@ -90,7 +96,6 @@ define("tinymce/WindowManager", [
|
||||
args.buttons = [
|
||||
{text: 'Ok', subtype: 'primary', onclick: function() {
|
||||
win.find('form')[0].submit();
|
||||
win.close();
|
||||
}},
|
||||
|
||||
{text: 'Cancel', onclick: function() {
|
||||
@ -111,7 +116,9 @@ define("tinymce/WindowManager", [
|
||||
}
|
||||
}
|
||||
|
||||
editor.focus();
|
||||
if (!windows.length) {
|
||||
editor.focus();
|
||||
}
|
||||
});
|
||||
|
||||
// Handle data
|
||||
@ -132,9 +139,11 @@ define("tinymce/WindowManager", [
|
||||
win.params = params || {};
|
||||
|
||||
// Takes a snapshot in the FocusManager of the selection before focus is lost to dialog
|
||||
editor.nodeChanged();
|
||||
if (windows.length === 1) {
|
||||
editor.nodeChanged();
|
||||
}
|
||||
|
||||
return win.renderTo(document.body).reflow();
|
||||
return win.renderTo().reflow();
|
||||
};
|
||||
|
||||
/**
|
||||
@ -153,6 +162,8 @@ define("tinymce/WindowManager", [
|
||||
MessageBox.alert(message, function() {
|
||||
if (callback) {
|
||||
callback.call(scope || this);
|
||||
} else {
|
||||
editor.focus();
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -216,5 +227,15 @@ define("tinymce/WindowManager", [
|
||||
getTopMostWindow().params = params;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the currently opened window objects.
|
||||
*
|
||||
* @method getWindows
|
||||
* @return {Array} Array of the currently opened windows.
|
||||
*/
|
||||
self.getWindows = function() {
|
||||
return windows;
|
||||
};
|
||||
};
|
||||
});
|
||||
|
Reference in New Issue
Block a user