From 532f1456507082c7681cb2efdde5bdd4db7b1101 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadatis Date: Mon, 24 Aug 2015 17:03:45 +0300 Subject: [PATCH] remove click event before applying it again --- js/floativ.js | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/js/floativ.js b/js/floativ.js index f4c68cd..fe9bbef 100644 --- a/js/floativ.js +++ b/js/floativ.js @@ -3,7 +3,7 @@ * displayed while browsing a web page. This floating box disappears when the user reaches an element with * a specific id. * - * Version 1.1.3 + * Version 1.1.4 * */ (function ($) { @@ -40,6 +40,7 @@ $this.data("floativ", o); // Save settings collapseBtn.hide(); // Hide minus-collapse sign + expandBtn.show(); floativWrapper.css({ height: o.height, width: o.width @@ -70,7 +71,7 @@ }); // Click expand button - expandBtn.on('click', function (e) { + expandBtn.off('click').on('click', function (e) { e.preventDefault(); collapseBtn.show(); expandBtn.hide(); @@ -81,7 +82,7 @@ }); // Click collapse button - collapseBtn.on('click', function (e) { + collapseBtn.off('click').on('click', function (e) { e.preventDefault(); expandBtn.show(); collapseBtn.hide(); diff --git a/package.json b/package.json index 79b4f03..c68f405 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "floativ", - "version": "1.1.3", + "version": "1.1.4", "description": "floativ is a floating scroll-box at the bottom of the screen of your site that contains text, among other things, which can be displayed while browsing a web page. This floating scroll-box disappears when the user reaches an element with a specific id.", "main": "floativ.js", "scripts": {