Sha256: c03640404b7d281af5c49e979a911c62bb3f6ae27efa2eaf9dc5f9b14abb0ef0

Contents?: true

Size: 1.47 KB

Versions: 13

Compression:

Stored size: 1.47 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.getElements('.quick_edit').addEvent('click', function(e){
			e.preventDefault();
			_this.fireEvent('quickEditStart', [this]);
		});
		scope.getElements('.action a').addEvent('click', 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

13 entries across 13 versions & 1 rubygems

Version Path
bhf-0.10.12 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.10.11 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.10.10 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.10.9 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.9.9 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.9.8 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.9.7 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.9.6 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.9.5 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.9.4 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.9.3 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.9.2 app/assets/javascripts/bhf/classes/PlatformHelper.js
bhf-0.9.1 app/assets/javascripts/bhf/classes/PlatformHelper.js