From 5bb5d990ddc771aac71b3ab148fe4e9b44ebd358 Mon Sep 17 00:00:00 2001 From: Will Bryant Date: Thu, 23 Jun 2011 17:40:33 +1200 Subject: [PATCH] add an onFinished event to complement onClear; rearrange slightly so you don't get both when clearing --- timeframe.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/timeframe.js b/timeframe.js index 2ca0376..7369c35 100644 --- a/timeframe.js +++ b/timeframe.js @@ -443,10 +443,13 @@ var Timeframe = Class.create({ if (!this.dragging) return; if (!this.stuck) { this.dragging = false; - if (event.findElement('span.clear span.active')) - this.clearRange(); if (this.timer) clearInterval(this.timer); + if (event.findElement('span.clear span.active')) { + this.clearRange(); + } else { + if (this.options.keys().include('onFinished')) this.options.get('onFinished')(); + } } this.mousedown = false; this.refreshRange();