TinyMCE:API/tinymce.WindowManager/confirm

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Method: confirm

Summary

Creates a confirm dialog. Please don't use the blocking behavior of this native version use the callback method instead then it can be extended. Using the window managers confirm method instead of using the normal JS confirm function enables you to replace the native confirm dialog with a inline custom dialog box.

Syntax

<void> confirm(<String> t, <function> cb, <Object> s)

Parameters

t
Title for the new confirm dialog.
cb
Callback function to be executed after the user has selected ok or cancel.
s
Optional scope to execute the callback in.

Examples

// Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm
tinyMCE.activeEditor.windowManager.confirm("Do you want to do something", function(s) {
   if (s)
      tinyMCE.activeEditor.windowManager.alert("Ok");
   else
      tinyMCE.activeEditor.windowManager.alert("Cancel");
});
Personal tools