diff options
| author | 2013-11-04 14:16:14 -0800 | |
|---|---|---|
| committer | 2013-11-04 14:16:14 -0800 | |
| commit | 7cf5e8ef33fa51c777f82585dfa116e4fa926371 (patch) | |
| tree | ef751687dbd492087022ac94c214f57ec44ae7e0 | |
| parent | aff58561e94396f2078c4f724cc50ab8acf26898 (diff) | |
| parent | 5c68233985b19262f44ff667417e0127df003854 (diff) | |
Merge pull request #215 from Alkarex/notificationsMain
Fusionne notification.js dans main.js
| -rw-r--r-- | app/App_FrontController.php | 1 | ||||
| -rw-r--r-- | public/scripts/main.js | 19 | ||||
| -rw-r--r-- | public/scripts/notification.js | 17 |
3 files changed, 19 insertions, 18 deletions
diff --git a/app/App_FrontController.php b/app/App_FrontController.php index 844956cf9..411550b38 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -65,7 +65,6 @@ class App_FrontController extends FrontController { if ($this->conf->lazyload () === 'yes') { View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js')); } - View::appendScript (Url::display ('/scripts/notification.js')); } private function loadNotifications () { diff --git a/public/scripts/main.js b/public/scripts/main.js index ea4f3bec6..ce589326e 100644 --- a/public/scripts/main.js +++ b/public/scripts/main.js @@ -453,6 +453,24 @@ function init_actualize() { }); } +function closeNotification () { + $(".notification").slideUp (200, function () { + $(".notification").remove (); + }); +} + +function init_notifications() { + notif = $(".notification"); + if (notif[0] !== undefined) { + timer = setInterval('closeNotification()', 5000); + + notif.find ("a.close").click (function () { + closeNotification (); + return false; + }); + } +} + $(function () { if (is_reader_mode()) { hide_posts = false; @@ -463,5 +481,6 @@ $(function () { init_stream_delegates($('#stream')); init_nav_entries(); init_templates(); + init_notifications(); init_actualize(); }); diff --git a/public/scripts/notification.js b/public/scripts/notification.js deleted file mode 100644 index e4f9fb649..000000000 --- a/public/scripts/notification.js +++ /dev/null @@ -1,17 +0,0 @@ -function closeNotification () { - $(".notification").slideUp (200, function () { - $(".notification").remove (); - }); -} - -$(document).ready (function () { - notif = $(".notification"); - if (notif[0] !== undefined) { - timer = setInterval('closeNotification()', 5000); - - notif.find ("a.close").click (function () { - closeNotification (); - return false; - }); - } -}); |
