浏览代码

Merge pull request #52 from AndrewEastwood/patch-3

Thanks, Andrew!

I notices the shortcuts support only two arguments - message and callback, hope we can make it more capable like BootstrapDialog.alert in the future.

Thank you :)
nakupanda 11 年之前
父节点
当前提交
6b9fc16b30
共有 1 个文件被更改,包括 39 次插入0 次删除
  1. 39 0
      js/bootstrap-dialog.js

+ 39 - 0
js/bootstrap-dialog.js

@@ -937,6 +937,45 @@
         }).open();
     };
 
+    /**
+     * Warning window
+     * 
+     * @param {type} message
+     * @returns the created dialog instance
+     */
+    BootstrapDialog.warning = function(message, callback) {
+        return new BootstrapDialog({
+            type: BootstrapDialog.TYPE_WARNING,
+            message: message
+        }).open();
+    };
+
+    /**
+     * Danger window
+     * 
+     * @param {type} message
+     * @returns the created dialog instance
+     */
+    BootstrapDialog.danger = function(message, callback) {
+        return new BootstrapDialog({
+            type: BootstrapDialog.TYPE_DANGER,
+            message: message
+        }).open();
+    };
+
+    /**
+     * Success window
+     * 
+     * @param {type} message
+     * @returns the created dialog instance
+     */
+    BootstrapDialog.success = function(message, callback) {
+        return new BootstrapDialog({
+            type: BootstrapDialog.TYPE_SUCCESS,
+            message: message
+        }).open();
+    };
+
     return BootstrapDialog;
 
 }));