Sha256: dde04f342d0d0e6030b9de96f9406c579ea142961316be7a24a29536463a19ca

Contents?: true

Size: 1.46 KB

Versions: 20

Compression:

Stored size: 1.46 KB

Contents

var PlatformHelper = new Class({
	version: 0.1,

	options: {
	},

	Implements: [Options, Events],

	initialize: function(_object, _options) {
		if ( ! _object) { return; }
		this.setOptions(_options);
		var scope = _object;
		var _this = this;

		scope.getElements('.pagination a, thead a').addEvent('click', function(e){
			e.preventDefault();
			_this.fireEvent('paginationStart', [this])
		});
		scope.getElements('.search').addEvent('submit', function(e){
			_this.fireEvent('search');
			e.preventDefault();
			var hidden_search = this.getElement('.hidden_search');
			if (hidden_search) {
				hidden_search.destroy();
			}
			var request = new Request.bhf({
				method: 'get',
				url: e.target.get('action'),
				onFailure: function(){
					_this.fireEvent('searchFailure');
				},
				onSuccess: function(a, b, html){
					scope.innerHTML = html;
					_this.fireEvent('searchSuccess', [request])
				}
			}).send({data: e.target});
		});
		scope.addEvent('click:relay(.quick_edit)', function(e){
			e.preventDefault();
			_this.fireEvent('quickEditStart', [this]);
		});
		scope.addEvent('click:relay(.action a, .js_toggle)', function(e){
			this.addClass('clicked');
			setTimeout(function(){
				this.removeClass('clicked');
			}.bind(this), 1500);
		});
		scope.getElements('.js_delete').addEvent('mouseenter', function(){
			this.getParent('tr').addClass('background_delete');
		}).addEvent('mouseleave', function(){
			this.getParent('tr').removeClass('background_delete');
		});
	}
});

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
bhf-1.0.0.beta16 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta15 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta14 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta13 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta12 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta11 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta10 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta9 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta8 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta7 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta6 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta5 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta4 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta3 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta2 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-1.0.0.beta1 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.10.17 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.10.16 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.10.15 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.10.14 app/assets/javascripts/bhf/classes/PlatformHelper.js