Ignore:
Timestamp:
Jan 12, 2014, 10:03:35 PM (10 years ago)
Author:
flop25
Message:

updated for 2.5 & 2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/stripped-galleria/galleria/themes/classic/galleria.classic.js

    r12975 r26671  
    11/**
    2  * @preserve Galleria Classic Theme 2011-08-01
    3  * http://galleria.aino.se
     2 * Galleria Classic Theme 2012-08-08
     3 * http://galleria.io
    44 *
    5  * Copyright (c) 2011, Aino
    6  * Licensed under the MIT license.
     5 * Licensed under the MIT license
     6 * https://raw.github.com/aino/galleria/master/LICENSE
     7 *
    78 */
    89
    9 /*global jQuery, Galleria */
     10(function($) {
    1011
    11 Galleria.requires(1.25, 'This version of Classic theme requires Galleria 1.2.5 or later');
    12 
    13 (function($) {
     12/*global window, jQuery, Galleria */
    1413
    1514Galleria.addTheme({
     
    2625    init: function(options) {
    2726
     27        Galleria.requires(1.33, 'This version of Classic theme requires Galleria 1.3.3 or later');
     28
    2829        // add some elements
    2930        this.addElement('info-link','info-close');
     
    3435        // cache some stuff
    3536        var info = this.$('info-link,info-close,info-text'),
    36             touch = Galleria.TOUCH,
    37             click = touch ? 'touchstart' : 'click';
     37            touch = Galleria.TOUCH;
    3838
    3939        // show loader & counter with opacity
     
    4949        // toggle info
    5050        if ( options._toggleInfo === true ) {
    51             info.bind( click, function() {
     51            info.bind( 'click:fast', function() {
    5252                info.toggle();
    5353            });
     
    7272                }
    7373            } else {
    74                 $(e.thumbTarget).css('opacity', this.getIndex() ? 1 : 0.6);
     74                $(e.thumbTarget).css('opacity', this.getIndex() ? 1 : 0.6).bind('click:fast', function() {
     75                    $(this).css( 'opacity', 1 ).parent().siblings().children().css('opacity', 0.6);
     76                });
    7577            }
    7678        });
     79
     80        var activate = function(e) {
     81            $(e.thumbTarget).css('opacity',1).parent().siblings().children().css('opacity', 0.6);
     82        };
    7783
    7884        this.bind('loadstart', function(e) {
     
    8086                this.$('loader').show().fadeTo(200, 0.4);
    8187            }
    82 
     88            window.setTimeout(function() {
     89                activate(e);
     90            }, touch ? 300 : 0);
    8391            this.$('info').toggle( this.hasInfo() );
    84 
    85             $(e.thumbTarget).css('opacity',1).parent().siblings().children().css('opacity', 0.6);
    8692        });
    8793
Note: See TracChangeset for help on using the changeset viewer.