From 049ff49562b71d32bb7341107ba3f4d2940150eb Mon Sep 17 00:00:00 2001 From: cinghie Date: Wed, 8 Jul 2015 01:34:07 +0200 Subject: [PATCH] Update JS to 1.04 and ordered after Bootstrap --- README.md | 14 +++++++++++++- assets/CookieAsset.php | 17 ++++++++++++++++- assets/js/cookieconsent.js | 5 +++-- widgets/CookieWidget.php | 2 +- widgets/views/cookieWidget.php | 2 +- 5 files changed, 34 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 11d8136..454c512 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,19 @@ Theme Options
  • All the themes you can use are in the assets/css folder
  • +Changelog +----------------- + + + Libraries Included ----------------- -https://github.com/silktide/cookieconsent2 (Version 1.0.3) +https://github.com/silktide/cookieconsent2 (Version 1.0.4) diff --git a/assets/CookieAsset.php b/assets/CookieAsset.php index 8e5f34b..df235f7 100644 --- a/assets/CookieAsset.php +++ b/assets/CookieAsset.php @@ -7,7 +7,7 @@ * @github https://github.com/cinghie/yii2-cookie-consent * @license GNU GENERAL PUBLIC LICENSE VERSION 3 * @package yii2-cookie-consent -* @version 1.0 +* @version 1.2.0 */ namespace cinghie\cookieconsent\assets; @@ -16,10 +16,25 @@ class CookieAsset extends AssetBundle { + /** + * @inherit + */ public $sourcePath = __DIR__; + /** + * @inherit + */ public $js=[ 'js/cookieconsent.js', ]; + + /** + * @inherit + */ + public $depends = [ + 'yii\web\YiiAsset', + 'yii\bootstrap\BootstrapAsset', + 'yii\bootstrap\BootstrapPluginAsset', + ]; } diff --git a/assets/js/cookieconsent.js b/assets/js/cookieconsent.js index 536a6e4..b1b823e 100644 --- a/assets/js/cookieconsent.js +++ b/assets/js/cookieconsent.js @@ -309,7 +309,8 @@ }, dismiss: function (evt) { - evt.preventDefault(); + evt.preventDefault && evt.preventDefault(); + evt.returnValue = false; this.setDismissedCookie(); this.container.removeChild(this.element); }, @@ -325,7 +326,7 @@ if (!initialized && document.readyState == 'complete') { cookieconsent.init(); initialized = true; - window[OPTIONS_UPDATER] = cookieconsent.setOptionsOnTheFly.bind(cookieconsent); + window[OPTIONS_UPDATER] = Util.bind(cookieconsent.setOptionsOnTheFly, cookieconsent); } })(); diff --git a/widgets/CookieWidget.php b/widgets/CookieWidget.php index 85c3ecf..6c9c885 100644 --- a/widgets/CookieWidget.php +++ b/widgets/CookieWidget.php @@ -7,7 +7,7 @@ * @github https://github.com/cinghie/yii2-cookie-consent * @license GNU GENERAL PUBLIC LICENSE VERSION 3 * @package yii2-cookie-consent -* @version 1.0 +* @version 1.2.0 */ namespace cinghie\cookieconsent\widgets; diff --git a/widgets/views/cookieWidget.php b/widgets/views/cookieWidget.php index 159ac31..590cf1e 100644 --- a/widgets/views/cookieWidget.php +++ b/widgets/views/cookieWidget.php @@ -7,7 +7,7 @@ * @github https://github.com/cinghie/yii2-cookie-consent * @license GNU GENERAL PUBLIC LICENSE VERSION 3 * @package yii2-cookie-consent -* @version 1.0 +* @version 1.2.0 */ use cinghie\cookieconsent\assets\CookieAsset;