From aa37ee66ff8aa098cdf6383175dd612f027ba88a Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 24 Nov 2013 23:30:06 +0100 Subject: [PATCH] Various JS optimizations --- public_html/media/js/core.js | 8 +------- public_html/media/js/post-list.js | 1 - public_html/media/js/post-view.js | 1 - src/Views/layout-normal.phtml | 9 ++++++++- src/Views/tag-mass-tag.phtml | 4 ++-- src/Views/tag-merge.phtml | 4 ++-- src/Views/tag-rename.phtml | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/public_html/media/js/core.js b/public_html/media/js/core.js index 1b0e688d..a4b4b8eb 100644 --- a/public_html/media/js/core.js +++ b/public_html/media/js/core.js @@ -206,7 +206,7 @@ function extractLast(term) $(function() { - $('[data-autocomplete-url]').each(function() + $('.autocomplete').each(function() { var searchInput = $(this); searchInput @@ -288,9 +288,3 @@ $(function() Mousetrap.bind('d', function() { var url = $('.paginator:visible .next:not(.disabled) a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }, 'keyup'); Mousetrap.bind('p', function() { $('.post a').eq(0).focus(); return false; }, 'keyup'); }); - - -$(function() -{ - $('body').trigger('dom-update'); -}); diff --git a/public_html/media/js/post-list.js b/public_html/media/js/post-list.js index 294af9f2..d3f5d016 100644 --- a/public_html/media/js/post-list.js +++ b/public_html/media/js/post-list.js @@ -34,5 +34,4 @@ $(function() }); }); }); - $('body').trigger('dom-update'); }); diff --git a/public_html/media/js/post-view.js b/public_html/media/js/post-view.js index 7aca027c..0dfebb4d 100644 --- a/public_html/media/js/post-view.js +++ b/public_html/media/js/post-view.js @@ -52,7 +52,6 @@ function onDomUpdate() $(function() { $('body').bind('dom-update', onDomUpdate); - onDomUpdate(); $('form.edit-post').submit(function(e) { diff --git a/src/Views/layout-normal.phtml b/src/Views/layout-normal.phtml index b7dee8c5..302d1db0 100644 --- a/src/Views/layout-normal.phtml +++ b/src/Views/layout-normal.phtml @@ -87,7 +87,7 @@ @@ -121,5 +121,12 @@ + + diff --git a/src/Views/tag-mass-tag.phtml b/src/Views/tag-mass-tag.phtml index 93332f72..fb3ec0c0 100644 --- a/src/Views/tag-mass-tag.phtml +++ b/src/Views/tag-mass-tag.phtml @@ -3,12 +3,12 @@

mass tag

-
+
-
+
diff --git a/src/Views/tag-merge.phtml b/src/Views/tag-merge.phtml index 36996ae2..93dc351d 100644 --- a/src/Views/tag-merge.phtml +++ b/src/Views/tag-merge.phtml @@ -3,12 +3,12 @@

merge tags

-
+
-
+
diff --git a/src/Views/tag-rename.phtml b/src/Views/tag-rename.phtml index f6bc741e..42cfc79c 100644 --- a/src/Views/tag-rename.phtml +++ b/src/Views/tag-rename.phtml @@ -3,7 +3,7 @@

rename tags

-
+