Browse Source

implemented modal-sm

Dante 11 years ago
parent
commit
cca281ed11

+ 1 - 0
changelog.txt

@@ -1,6 +1,7 @@
 LASTEST NOT RELEASED
 ------------------------------
 * FIXED #102 *
+* Implemented modal-sm, REFS #105 *
 
 V1.34.1
 ------------------------------

+ 3 - 3
dist/css/bootstrap-dialog.css

@@ -12,7 +12,7 @@
 .bootstrap-dialog.type-default .bootstrap-dialog-title {
     color: #333;
 }
-.bootstrap-dialog.size-normal .bootstrap-dialog-title {
+.bootstrap-dialog .bootstrap-dialog-title {
     font-size: 16px;
 }
 .bootstrap-dialog.size-large .bootstrap-dialog-title {
@@ -25,7 +25,7 @@
     -khtml-opacity: 0.9;
     opacity: 0.9;
 }
-.bootstrap-dialog.size-normal .bootstrap-dialog-close-button {
+.bootstrap-dialog .bootstrap-dialog-close-button {
     font-size: 20px;
 }
 .bootstrap-dialog.size-large .bootstrap-dialog-close-button {
@@ -38,7 +38,7 @@
     -khtml-opacity: 1;
     opacity: 1;
 }
-.bootstrap-dialog.size-normal .bootstrap-dialog-message {
+.bootstrap-dialog .bootstrap-dialog-message {
     font-size: 14px;
 }
 .bootstrap-dialog.size-large .bootstrap-dialog-message {

File diff suppressed because it is too large
+ 1 - 1
dist/css/bootstrap-dialog.min.css


+ 9 - 0
dist/js/bootstrap-dialog.js

@@ -206,11 +206,13 @@
     BootstrapDialog.DEFAULT_TEXTS['CANCEL'] = 'Cancel';
 
     BootstrapDialog.SIZE_NORMAL = 'size-normal';
+    BootstrapDialog.SIZE_SMALL = 'size-small';
     BootstrapDialog.SIZE_WIDE = 'size-wide';    // size-wide is equal to modal-lg
     BootstrapDialog.SIZE_LARGE = 'size-large';
 
     BootstrapDialog.BUTTON_SIZES = {};
     BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_NORMAL] = '';
+    BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_SMALL] = '';
     BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_WIDE] = '';
     BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_LARGE] = 'btn-lg';
 
@@ -486,10 +488,17 @@
 
                 // Dialog size
                 this.getModal().removeClass(BootstrapDialog.SIZE_NORMAL)
+                .removeClass(BootstrapDialog.SIZE_SMALL)
                 .removeClass(BootstrapDialog.SIZE_WIDE)
                 .removeClass(BootstrapDialog.SIZE_LARGE);
                 this.getModal().addClass(this.getSize());
 
+                // Smaller dialog.
+                this.getModalDialog().removeClass('modal-sm');
+                if (this.getSize() === BootstrapDialog.SIZE_SMALL) {
+                    this.getModalDialog().addClass('modal-sm');
+                }
+
                 // Wider dialog.
                 this.getModalDialog().removeClass('modal-lg');
                 if (this.getSize() === BootstrapDialog.SIZE_WIDE) {

File diff suppressed because it is too large
+ 1 - 1
dist/js/bootstrap-dialog.min.js


+ 0 - 13
dist/less/bootstrap-dialog.less

@@ -66,19 +66,6 @@
         }
     }
 
-    /* dialog sizes */
-    &.size-normal {
-        .bootstrap-dialog-title {
-            font-size: 16px;
-        }
-        .bootstrap-dialog-close-button {
-            font-size: 20px;
-        }
-        .bootstrap-dialog-message {
-            font-size: 14px;
-        }
-    }
-
     &.size-large {
         .bootstrap-dialog-title {
             font-size: 24px;

+ 3 - 3
examples/assets/bootstrap-dialog/css/bootstrap-dialog.css

@@ -12,7 +12,7 @@
 .bootstrap-dialog.type-default .bootstrap-dialog-title {
     color: #333;
 }
-.bootstrap-dialog.size-normal .bootstrap-dialog-title {
+.bootstrap-dialog .bootstrap-dialog-title {
     font-size: 16px;
 }
 .bootstrap-dialog.size-large .bootstrap-dialog-title {
@@ -25,7 +25,7 @@
     -khtml-opacity: 0.9;
     opacity: 0.9;
 }
-.bootstrap-dialog.size-normal .bootstrap-dialog-close-button {
+.bootstrap-dialog .bootstrap-dialog-close-button {
     font-size: 20px;
 }
 .bootstrap-dialog.size-large .bootstrap-dialog-close-button {
@@ -38,7 +38,7 @@
     -khtml-opacity: 1;
     opacity: 1;
 }
-.bootstrap-dialog.size-normal .bootstrap-dialog-message {
+.bootstrap-dialog .bootstrap-dialog-message {
     font-size: 14px;
 }
 .bootstrap-dialog.size-large .bootstrap-dialog-message {

File diff suppressed because it is too large
+ 1 - 1
examples/assets/bootstrap-dialog/css/bootstrap-dialog.min.css


+ 9 - 0
examples/assets/bootstrap-dialog/js/bootstrap-dialog.js

@@ -206,11 +206,13 @@
     BootstrapDialog.DEFAULT_TEXTS['CANCEL'] = 'Cancel';
 
     BootstrapDialog.SIZE_NORMAL = 'size-normal';
+    BootstrapDialog.SIZE_SMALL = 'size-small';
     BootstrapDialog.SIZE_WIDE = 'size-wide';    // size-wide is equal to modal-lg
     BootstrapDialog.SIZE_LARGE = 'size-large';
 
     BootstrapDialog.BUTTON_SIZES = {};
     BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_NORMAL] = '';
+    BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_SMALL] = '';
     BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_WIDE] = '';
     BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_LARGE] = 'btn-lg';
 
@@ -486,10 +488,17 @@
 
                 // Dialog size
                 this.getModal().removeClass(BootstrapDialog.SIZE_NORMAL)
+                .removeClass(BootstrapDialog.SIZE_SMALL)
                 .removeClass(BootstrapDialog.SIZE_WIDE)
                 .removeClass(BootstrapDialog.SIZE_LARGE);
                 this.getModal().addClass(this.getSize());
 
+                // Smaller dialog.
+                this.getModalDialog().removeClass('modal-sm');
+                if (this.getSize() === BootstrapDialog.SIZE_SMALL) {
+                    this.getModalDialog().addClass('modal-sm');
+                }
+
                 // Wider dialog.
                 this.getModalDialog().removeClass('modal-lg');
                 if (this.getSize() === BootstrapDialog.SIZE_WIDE) {

File diff suppressed because it is too large
+ 1 - 1
examples/assets/bootstrap-dialog/js/bootstrap-dialog.min.js


+ 0 - 13
examples/assets/bootstrap-dialog/less/bootstrap-dialog.less

@@ -66,19 +66,6 @@
         }
     }
 
-    /* dialog sizes */
-    &.size-normal {
-        .bootstrap-dialog-title {
-            font-size: 16px;
-        }
-        .bootstrap-dialog-close-button {
-            font-size: 20px;
-        }
-        .bootstrap-dialog-message {
-            font-size: 14px;
-        }
-    }
-
     &.size-large {
         .bootstrap-dialog-title {
             font-size: 24px;

+ 6 - 0
examples/index.html

@@ -480,6 +480,12 @@
                     dialog.setSize(BootstrapDialog.SIZE_NORMAL);
                 }
             }, {
+                label: 'Small',
+                action: function(dialog){
+                    dialog.setTitle('Small');
+                    dialog.setSize(BootstrapDialog.SIZE_SMALL);
+                }
+            }, {
                 label: 'Wide',
                 action: function(dialog){
                     dialog.setTitle('Wide');

+ 3 - 3
src/css/bootstrap-dialog.css

@@ -12,7 +12,7 @@
 .bootstrap-dialog.type-default .bootstrap-dialog-title {
     color: #333;
 }
-.bootstrap-dialog.size-normal .bootstrap-dialog-title {
+.bootstrap-dialog .bootstrap-dialog-title {
     font-size: 16px;
 }
 .bootstrap-dialog.size-large .bootstrap-dialog-title {
@@ -25,7 +25,7 @@
     -khtml-opacity: 0.9;
     opacity: 0.9;
 }
-.bootstrap-dialog.size-normal .bootstrap-dialog-close-button {
+.bootstrap-dialog .bootstrap-dialog-close-button {
     font-size: 20px;
 }
 .bootstrap-dialog.size-large .bootstrap-dialog-close-button {
@@ -38,7 +38,7 @@
     -khtml-opacity: 1;
     opacity: 1;
 }
-.bootstrap-dialog.size-normal .bootstrap-dialog-message {
+.bootstrap-dialog .bootstrap-dialog-message {
     font-size: 14px;
 }
 .bootstrap-dialog.size-large .bootstrap-dialog-message {

+ 9 - 0
src/js/bootstrap-dialog.js

@@ -206,11 +206,13 @@
     BootstrapDialog.DEFAULT_TEXTS['CANCEL'] = 'Cancel';
 
     BootstrapDialog.SIZE_NORMAL = 'size-normal';
+    BootstrapDialog.SIZE_SMALL = 'size-small';
     BootstrapDialog.SIZE_WIDE = 'size-wide';    // size-wide is equal to modal-lg
     BootstrapDialog.SIZE_LARGE = 'size-large';
 
     BootstrapDialog.BUTTON_SIZES = {};
     BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_NORMAL] = '';
+    BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_SMALL] = '';
     BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_WIDE] = '';
     BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_LARGE] = 'btn-lg';
 
@@ -486,10 +488,17 @@
 
                 // Dialog size
                 this.getModal().removeClass(BootstrapDialog.SIZE_NORMAL)
+                .removeClass(BootstrapDialog.SIZE_SMALL)
                 .removeClass(BootstrapDialog.SIZE_WIDE)
                 .removeClass(BootstrapDialog.SIZE_LARGE);
                 this.getModal().addClass(this.getSize());
 
+                // Smaller dialog.
+                this.getModalDialog().removeClass('modal-sm');
+                if (this.getSize() === BootstrapDialog.SIZE_SMALL) {
+                    this.getModalDialog().addClass('modal-sm');
+                }
+
                 // Wider dialog.
                 this.getModalDialog().removeClass('modal-lg');
                 if (this.getSize() === BootstrapDialog.SIZE_WIDE) {

+ 0 - 13
src/less/bootstrap-dialog.less

@@ -66,19 +66,6 @@
         }
     }
 
-    /* dialog sizes */
-    &.size-normal {
-        .bootstrap-dialog-title {
-            font-size: 16px;
-        }
-        .bootstrap-dialog-close-button {
-            font-size: 20px;
-        }
-        .bootstrap-dialog-message {
-            font-size: 14px;
-        }
-    }
-
     &.size-large {
         .bootstrap-dialog-title {
             font-size: 24px;