Sha256: 55df28b763383d158ddfb06588597982207c9b58d84babf69c33b01631cc8696
Contents?: true
Size: 754 Bytes
Versions: 5
Compression:
Stored size: 754 Bytes
Contents
Form.DelayedObserver = Class.create(Form.Observer, { initialize: function($super, element, frequency, callback) { $super(element, frequency, callback); this.invocationPending = false; }, // Overrides Abstract.TimedObserver.execute execute: function() { var value = this.getValue(); if (Object.isString(this.lastValue) && Object.isString(value) ? this.lastValue != value : String(this.lastValue) != String(value)) { this.lastValue = value; this.invocationPending = true; } else if(this.invocationPending) { this.invocationPending = false; this.callback(this.element, value); this.lastValue = value; } } });
Version data entries
5 entries across 3 versions & 1 rubygems