浏览代码

Updated example

Dante 12 年之前
父节点
当前提交
8f67737340
共有 2 个文件被更改,包括 14 次插入4 次删除
  1. 1 3
      assets/bootstrap-dialog/js/bootstrap-dialog.js
  2. 13 1
      index.html

+ 1 - 3
assets/bootstrap-dialog/js/bootstrap-dialog.js

@@ -275,9 +275,7 @@ var BootstrapDialog = null;
             $container.append(this.createTitleContent());
             $container.append(this.createTitleContent());
 
 
             // Close button
             // Close button
-            if (this.isClosable()) {
-                $container.append(this.createCloseButton());
-            }
+            $container.append(this.createCloseButton());
 
 
             return $container;
             return $container;
         },
         },

+ 13 - 1
index.html

@@ -209,7 +209,7 @@
         -->
         -->
     </div>
     </div>
     
     
-    <h3>Dialog unclosable</h3>
+    <h3>Dialog closable / unclosable</h3>
     <p>
     <p>
         If option 'closable' is set to false, the default closing behaviors will be disabled, but you can still close the dialog by using dialog.close().
         If option 'closable' is set to false, the default closing behaviors will be disabled, but you can still close the dialog by using dialog.close().
     </p>
     </p>
@@ -219,6 +219,18 @@
             message: 'Hi Apple!',
             message: 'Hi Apple!',
             closable: false,
             closable: false,
             buttons: [{
             buttons: [{
+                label: 'Dialog CLOSABLE!',
+                cssClass: 'btn-success',
+                action: function(dialogRef){
+                    dialogRef.setClosable(true);
+                }
+            }, {
+                label: 'Dialog UNCLOSABLE!',
+                cssClass: 'btn-warning',
+                action: function(dialogRef){
+                    dialogRef.setClosable(false);
+                }
+            }, {
                 label: 'Close the dialog',
                 label: 'Close the dialog',
                 action: function(dialogRef){
                 action: function(dialogRef){
                     dialogRef.close();
                     dialogRef.close();