Sha256: 77bc09636bff90b8a25649d2103f095ce2dc4b89069477dbefc8442f3c5d9dad

Contents?: true

Size: 812 Bytes

Versions: 8

Compression:

Stored size: 812 Bytes

Contents

if (typeof(Alchemy) === 'undefined') {
	var Alchemy = {};
}

(function($) {

	$.extend(Alchemy, {

		ButtonObserver: function (selector) {
			$(selector).click(function(event) {
				Alchemy.disableButton(this);
			});
		},

		disableButton: function (button) {
			var $button = $(button), $clone = $button.clone(), width = $button.outerWidth(), text = $button.text();
			$button.hide();
			$button.parent().append($clone);
			$clone.attr({disabled: true, href: 'javascript:void(0)'})
			.addClass('disabled cloned-button')
			.css({width: width})
			.html('<img src="/assets/alchemy/ajax_loader.gif">')
			.show();
			return true;
		},

		enableButton: function (button) {
			var $button = $(button);
			$button.show();
			$button.parent().find('.cloned-button').remove();
			return true;
		}

	});

})(jQuery);

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
alchemy_cms-2.1.rc6 app/assets/javascripts/alchemy/alchemy.buttons.js
alchemy_cms-2.1.rc5 app/assets/javascripts/alchemy/alchemy.buttons.js
alchemy_cms-2.1.rc4 app/assets/javascripts/alchemy/alchemy.buttons.js
alchemy_cms-2.1.rc3 app/assets/javascripts/alchemy/alchemy.buttons.js
alchemy_cms-2.1.rc2 app/assets/javascripts/alchemy/alchemy.buttons.js
alchemy_cms-2.1.beta6 app/assets/javascripts/alchemy/alchemy.buttons.js
alchemy_cms-2.1.beta5 app/assets/javascripts/alchemy/alchemy.buttons.js
alchemy_cms-2.1.beta1 app/assets/javascripts/alchemy/alchemy.buttons.js