Skip to content

Commit

Permalink
Add option 'animate' for fading effect control.
Browse files Browse the repository at this point in the history
Note: Sorry guys, the new files are compressed by YUI compressor because I don't have gulp installed on this computer.
  • Loading branch information
nakupanda committed Jun 23, 2014
1 parent 8c6da2d commit 35c62dc
Show file tree
Hide file tree
Showing 11 changed files with 246 additions and 170 deletions.
152 changes: 76 additions & 76 deletions dist/css/bootstrap-dialog.css
Original file line number Diff line number Diff line change
@@ -1,120 +1,120 @@
.bootstrap-dialog {
/* dialog types */
/* dialog sizes */
/**
* Icon animation
* Copied from font-awesome: http://fontawesome.io/
**/
/** End of icon animation **/

}
.bootstrap-dialog .modal-header {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.bootstrap-dialog .bootstrap-dialog-title {
color: #fff;
display: inline-block;
color: #fff;
display: inline-block;
}
.bootstrap-dialog .bootstrap-dialog-button-icon {
margin-right: 3px;
.bootstrap-dialog.type-default .bootstrap-dialog-title {
color: #333;
}
.bootstrap-dialog.size-normal .bootstrap-dialog-title {
font-size: 16px;
}
.bootstrap-dialog.size-large .bootstrap-dialog-title {
font-size: 24px;
}
.bootstrap-dialog .bootstrap-dialog-close-button {
float: right;
filter: alpha(opacity=90);
-moz-opacity: 0.9;
-khtml-opacity: 0.9;
opacity: 0.9;
float: right;
filter:alpha(opacity=90);
-moz-opacity:0.9;
-khtml-opacity: 0.9;
opacity: 0.9;
}
.bootstrap-dialog.size-normal .bootstrap-dialog-close-button {
font-size: 20px;
}
.bootstrap-dialog.size-large .bootstrap-dialog-close-button {
font-size: 30px;
}
.bootstrap-dialog .bootstrap-dialog-close-button:hover {
cursor: pointer;
filter: alpha(opacity=100);
-moz-opacity: 1;
-khtml-opacity: 1;
opacity: 1;
cursor: pointer;
filter: alpha(opacity=100);
-moz-opacity: 1;
-khtml-opacity: 1;
opacity: 1;
}
.bootstrap-dialog.type-default .modal-header {
background-color: #fff;
.bootstrap-dialog.size-normal .bootstrap-dialog-message {
font-size: 14px;
}
.bootstrap-dialog.type-default .bootstrap-dialog-title {
color: #333;
.bootstrap-dialog.size-large .bootstrap-dialog-message {
font-size: 18px;
}
.bootstrap-dialog.type-default .modal-header {
background-color: #fff;
}
.bootstrap-dialog.type-info .modal-header {
background-color: #5bc0de;
background-color: #5bc0de;
}
.bootstrap-dialog.type-primary .modal-header {
background-color: #428bca;
background-color: #428bca;
}
.bootstrap-dialog.type-success .modal-header {
background-color: #5cb85c;
background-color: #5cb85c;
}
.bootstrap-dialog.type-warning .modal-header {
background-color: #f0ad4e;
background-color: #f0ad4e;
}
.bootstrap-dialog.type-danger .modal-header {
background-color: #d9534f;
}
.bootstrap-dialog.size-normal .bootstrap-dialog-title {
font-size: 16px;
}
.bootstrap-dialog.size-normal .bootstrap-dialog-close-button {
font-size: 20px;
background-color: #d9534f;
}
.bootstrap-dialog.size-normal .bootstrap-dialog-message {
font-size: 14px;
}
.bootstrap-dialog.size-large .bootstrap-dialog-title {
font-size: 24px;
}
.bootstrap-dialog.size-large .bootstrap-dialog-close-button {
font-size: 30px;
}
.bootstrap-dialog.size-large .bootstrap-dialog-message {
font-size: 18px;
}
.bootstrap-dialog .icon-spin {
display: inline-block;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
-webkit-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
.bootstrap-dialog .bootstrap-dialog-button-icon {
margin-right: 3px;
}

/**
* Icon animation
* Copied from font-awesome: http://fontawesome.io/
**/
.icon-spin {
display: inline-block;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
-webkit-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
}
@-moz-keyframes spin {
0% {
0% {
-moz-transform: rotate(0deg);
}
100% {
}
100% {
-moz-transform: rotate(359deg);
}
}
}
@-webkit-keyframes spin {
0% {
0% {
-webkit-transform: rotate(0deg);
}
100% {
}
100% {
-webkit-transform: rotate(359deg);
}
}
}
@-o-keyframes spin {
0% {
0% {
-o-transform: rotate(0deg);
}
100% {
}
100% {
-o-transform: rotate(359deg);
}
}
}
@-ms-keyframes spin {
0% {
0% {
-ms-transform: rotate(0deg);
}
100% {
}
100% {
-ms-transform: rotate(359deg);
}
}
}
@keyframes spin {
0% {
0% {
transform: rotate(0deg);
}
100% {
}
100% {
transform: rotate(359deg);
}
}
}
/** End of icon animation **/
2 changes: 1 addition & 1 deletion dist/css/bootstrap-dialog.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 22 additions & 5 deletions dist/js/bootstrap-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
return factory($);
});
} else {
// planted over the root!
root.BootstrapDialog = factory(root.jQuery);
// planted over the root!
root.BootstrapDialog = factory(root.jQuery);
}

}(this, function($) {
Expand Down Expand Up @@ -102,7 +102,8 @@
closeByKeyboard: true,
spinicon: BootstrapDialog.ICON_SPINNER,
autodestroy: true,
draggable: false
draggable: false,
animate: true
};

/**
Expand Down Expand Up @@ -157,7 +158,7 @@
return this;
},
createModal: function() {
var $modal = $('<div class="modal fade" tabindex="-1"></div>');
var $modal = $('<div class="modal" tabindex="-1"></div>');
$modal.prop('id', this.getId());

return $modal;
Expand Down Expand Up @@ -344,6 +345,21 @@
canCloseByKeyboard: function() {
return this.options.closeByKeyboard;
},
isAnimate: function() {
return this.options.animate;
},
setAnimate: function(animate) {
this.options.animate = animate;

return this;
},
updateAnimate: function() {
if (this.isRealized()) {
this.getModal().toggleClass('fade', this.isAnimate());
}

return this;
},
getSpinicon: function() {
return this.options.spinicon;
},
Expand Down Expand Up @@ -789,6 +805,7 @@
this.updateTitle();
this.updateMessage();
this.updateClosable();
this.updateAnimate();

return this;
},
Expand Down Expand Up @@ -920,6 +937,6 @@
}).open();
};

return BootstrapDialog;
return BootstrapDialog;

}));
Loading

0 comments on commit 35c62dc

Please sign in to comment.