You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
893 B
33 lines
893 B
8 years ago
|
/*!
|
||
|
* remark (http://getbootstrapadmin.com/remark)
|
||
|
* Copyright 2016 amazingsurge
|
||
|
* Licensed under the Themeforest Standard Licenses
|
||
|
*/
|
||
|
$.components.register("buttons", {
|
||
|
mode: "api",
|
||
|
defaults: {},
|
||
|
api: function() {
|
||
|
$(document).on('click.site.loading', '[data-loading-text]', function() {
|
||
|
var $btn = $(this),
|
||
|
text = $btn.text(),
|
||
|
i = 20,
|
||
|
loadingText = $btn.data('loadingText');
|
||
|
|
||
|
$btn.text(loadingText + '(' + i + ')').css('opacity', '.6');
|
||
|
|
||
|
var timeout = setInterval(function() {
|
||
|
$btn.text(loadingText + '(' + (--i) + ')');
|
||
|
if (i === 0) {
|
||
|
clearInterval(timeout);
|
||
|
$btn.text(text).css('opacity', '1');
|
||
|
}
|
||
|
}, 1000);
|
||
|
});
|
||
|
|
||
|
$(document).on('click.site.morebutton', '[data-more]', function() {
|
||
|
var $target = $($(this).data('more'));
|
||
|
$target.toggleClass('show');
|
||
|
});
|
||
|
}
|
||
|
});
|