From 9da584394752fdec5a7f86fe46c70aab02ca98bb Mon Sep 17 00:00:00 2001 From: skullbocks Date: Sun, 27 Jul 2014 12:55:46 +0200 Subject: [PATCH] [WebUI #7] Changed javascript to use .iso class --- assets/public/js/isotope_script.js | 43 ++++++++++++------------------ assets/public/js/libs/extern.js | 4 +-- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/assets/public/js/isotope_script.js b/assets/public/js/isotope_script.js index 8de8eaa..d415c92 100644 --- a/assets/public/js/isotope_script.js +++ b/assets/public/js/isotope_script.js @@ -1,31 +1,22 @@ (function (window, $, undefined) { $(document).ready(function() { - var $container = $('.iso,#iso'); - - // Fire Isotope only when images are loaded - $container.imagesLoaded(function(){ - $container.isotope({ - itemSelector : '.post', - masonry: { - isFitWidth: true, - } - }); - }); - $("[rel='tooltip']").tooltip(); - $('.tile_detail').hammer({}).on("tap", function(event) { - if ( $(this).find('.caption').is( ":hidden" ) ) { - $(this).find('.caption').slideDown( 250 ); - } else { - $(this).find('.caption').slideUp( 250 ); - } - }); - $('.tile_detail').hover(function(){ - $(this).find('.caption').slideDown(250); - }, - function(){ - $(this).find('.caption').slideUp(250); - } - ); + var $room = $('.room'); + var $container = $('.iso,#iso').isotope({ + itemSelector: '.tile-item', + layoutMode: 'fitRows', + getSortData: { + name: '.name', + pinNumber: '.pin-number', + room: '[data-room]', + tag:'[data-tag]' + }, + masonry: { + isFitWidth: true, + } + }); + $room.click(function() { + $container.isotope({ filter: $( this ).attr('id') }); + }); }); })(window, jQuery); \ No newline at end of file diff --git a/assets/public/js/libs/extern.js b/assets/public/js/libs/extern.js index fcae565..3c842e0 100644 --- a/assets/public/js/libs/extern.js +++ b/assets/public/js/libs/extern.js @@ -1,5 +1,5 @@ $(document).ready(function() { - var $container = $('#iso'); + var $container = $('.iso,#iso'); // Fire Isotope only when images are loaded $container.imagesLoaded(function(){ @@ -14,7 +14,7 @@ $(document).ready(function() { }); // Infinite Scroll - $('#iso').infinitescroll({ + $('.iso,#iso').infinitescroll({ navSelector : 'div.pagination', nextSelector : 'div.pagination a:first', itemSelector : '.alert',