From: stephen@cubedesigners.com Date: Tue, 23 Dec 2014 14:49:50 +0000 (+0000) Subject: - Add "Fermer" link to portfolio items X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c61bf4fea778963a07b5e7e67bba7ca7737fbc36;p=cubedesigners-v7.git - Add "Fermer" link to portfolio items - Make portfolio list remember last filter so state is preserved when going back from viewing a portfolio item - Remove 'Voir le site' on portfolio items that have no URL set - Ensure image(s) are positioned correctly in portfolio scroller when there are not many images --- diff --git a/framework/application/views/helpers/Realisation.php b/framework/application/views/helpers/Realisation.php index e5fc38e..12eaeaa 100644 --- a/framework/application/views/helpers/Realisation.php +++ b/framework/application/views/helpers/Realisation.php @@ -12,6 +12,7 @@ class Cubedesigners_View_Helper_Realisation extends CubeIT_View_Helper_Abstract $res .= '
'; $res .= '

' . $r->titre . '

'; $res .= '

' . Cubedesigners_Util::getCategoryById($r->categories) . '

'; + $res .= $this->view->link(__('Fermer'), $this->currentPage->getParent()->getHref(), array('class' => 'close')); $res.='
'; $slides = array(); @@ -25,7 +26,11 @@ class Cubedesigners_View_Helper_Realisation extends CubeIT_View_Helper_Abstract $res.=$this->imageSlideshowScroll($slides, 439, array(), array('shortcuts' => false)); $res.='
'; - $res.=$this->_button($r->url); + + if (!empty($r->url->url)) { + $res.=$this->_button($r->url); + } + $res.=$this->markupDotclear($r->description); $res.='
'; $res.=''; diff --git a/images/close-portfolio.png b/images/close-portfolio.png new file mode 100644 index 0000000..d8b66dd Binary files /dev/null and b/images/close-portfolio.png differ diff --git a/js/realisations.js b/js/realisations.js index fd14ecb..b459321 100644 --- a/js/realisations.js +++ b/js/realisations.js @@ -134,13 +134,13 @@ function load_realisations() { $('.close').css("top", $('#detailContent').offset().top); /* $( "#detail" ).slideDown( "slow", function() { - + isAnim = false; addCloseAction(); currentSlide = 1; autoSlide = true; initSlideShow(); - + }).animate( { opacity: 1 }, { queue: true, duration: 'slow' } diff --git a/js/taglist.js b/js/taglist.js index 0d729c8..65bd71c 100644 --- a/js/taglist.js +++ b/js/taglist.js @@ -1,27 +1,35 @@ (function ($) { function JQtaglist(element) { + + // Store name of the list + this.storageID = $(element).parent().attr('id') + '-filter'; + this.element = element; this.perline = parseInt(this.element.data('perline')); this.list = $(this.element.data('list')); - this.init(); + + var initFilter = 0; + if (Modernizr.sessionstorage) { + var f = sessionStorage.getItem(this.storageID); + if (f !== null) { + initFilter = f; + } + } + + this.init(initFilter); } JQtaglist.prototype = { - init: function () { + init: function (initFilter) { var $this = this; this.element.on('click', "li[data-id]", function () { - if ($(this).hasClass('active')) { - return false; - } var id = $(this).data('id'); $this.filter(id); - $(this).siblings().removeClass('active'); - $(this).addClass('active'); return false; }); - $this.filter(0); + $this.filter(initFilter); }, filter: function (id) { var $this = this; @@ -30,10 +38,17 @@ this.list.find('[data-cat][data-cat!="' + id + '"]').hide(); } + this.element.find('[data-id]').removeClass('active'); + this.element.find('[data-id="' + id + '"]').addClass('active'); + this.updateMargins(); setTimeout(function () { $this.updateMargins(); }, 500); + + if (Modernizr.sessionstorage) { + sessionStorage.setItem(this.storageID, id); + } }, updateMargins: function () { var i = 1; diff --git a/less/realisation.less b/less/realisation.less index 51ac7d7..dfd8333 100644 --- a/less/realisation.less +++ b/less/realisation.less @@ -17,4 +17,27 @@ clear: both; margin:30px 0 30px 0; } + + .content { + position: relative; + + .close { + display: inline-block; + position: absolute; + right: 0; + top: 50%; + margin-top: -13px; // Half of line-height to position vertically in the centre + background-image: url(../images/close-portfolio.png); + background-repeat: no-repeat; + background-position: right center; + padding-right: 33px; + color: #545454; + font-size: 14px; + line-height: 26px; + + &:hover { + color: #000; + } + } + } } \ No newline at end of file