diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-04-27 17:46:49 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-04-27 17:46:49 -0400 |
| commit | 21dfb9327f8acb95a5e81c4261fc00392b67e8c6 (patch) | |
| tree | 405f6a757a37e0f6682c355eed31d35599462107 | |
| parent | 436703a1525c1cf1565fd922a9e661b9a0c845c2 (diff) | |
fix flickity version
| -rw-r--r-- | site/db.json | 70 | ||||
| -rw-r--r-- | site/public/assets/javascripts/_env.js | 3 | ||||
| -rw-r--r-- | site/public/assets/javascripts/vendor/flickity.pkgd.js | 215 | ||||
| -rw-r--r-- | themes/okadmin/public/js/app.js | 1 |
4 files changed, 139 insertions, 150 deletions
diff --git a/site/db.json b/site/db.json index 591706f..3d55602 100644 --- a/site/db.json +++ b/site/db.json @@ -5,9 +5,9 @@ "content": [], "advertising": [ { - "id": "diesel-spring-summer-2015", - "title": "Diesel Spring/Summer 2015", - "menu": "Diesel S/S 2015", + "id": "diesel-s-s-2015", + "title": "Diesel S/S 2015", + "menu": "Diesel Spring/Summer 2015", "description": "FOR SPRING 2015, FORMICHETTI ESTABLISHES THE KEY PIECES THAT HAVE COME TO REFLECT DIESEL’S NEW ERA AND CHARACTERIZE ITS DNA, AND THE FACES WHO BEST REFLECT THE PAST, PRESENT, AND FUTURE OF THE BRAND. IN A REVOLUTIONARY CAMPAIGN BY NICK KNIGHT, FORMICHETTI HIGHLIGHTS HIS PERSONAL HEROES, WHICH INCLUDE NEW FACES AND THE ARTISTS, INNOVATORS, MUSES, AND FRIENDS WHO INSPIRE HIM, AS WELL AS A FEW HEROES FROM PAST CAMPAIGNS. COMBINING CLASSIC PORTRAITURE WITH FUTURISTIC, DIGITAL ELEMENTS, THE CAMPAIGN WILL JUXTAPOSE THE INDIVIDUALS WHO MAKE UP DIESEL’SCOMMUNITY WITH THE “HERO” PIECES THAT BEST DEFINE THE STATEMENT OF THE BRAND TODAY.", "video": { "url": "", @@ -24,19 +24,25 @@ "thumb": "http://i.vimeocdn.com/video/497493142_640.jpg" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fe22fd077-ca52-42a1-ab9c-e0508bf4408e.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F1b55cd3c-eb7d-4ed6-bfe9-2bc53960987d.jpg", "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F1afaa719-c18f-4155-a42f-3e7fc10247c3.jpg", + "type": "vimeo", + "token": "125927621", + "title": "the Vampyre of Time and Memory", + "thumb": "http://i.vimeocdn.com/video/516197938_640.jpg" + }, + { + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F86a3edfe-bdbb-44ac-9e50-e167c16c89b9.jpg", "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F1b55cd3c-eb7d-4ed6-bfe9-2bc53960987d.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F1afaa719-c18f-4155-a42f-3e7fc10247c3.jpg", "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fe402bfbb-b101-4b42-afcb-818f7b616db9.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F38cb4454-34a4-44af-8243-53da4d2b7c47.jpg", "caption": "" }, { @@ -44,28 +50,28 @@ "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F38cb4454-34a4-44af-8243-53da4d2b7c47.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F5bdc8f95-b18f-407a-b2f3-33df1025bf8a.jpg", "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F86a3edfe-bdbb-44ac-9e50-e167c16c89b9.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fe22fd077-ca52-42a1-ab9c-e0508bf4408e.jpg", "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F5bdc8f95-b18f-407a-b2f3-33df1025bf8a.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fe402bfbb-b101-4b42-afcb-818f7b616db9.jpg", "caption": "" } ], "thumbnail": { - "uri": "", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F479667e9-a89d-4c19-935a-b78f3aaf64e6.jpg", "caption": "" }, "__index": "0" }, { - "id": "diesel-fall-winter-2014", - "title": "Diesel Fall/Winter 2014", - "menu": "Diesel F/W 2014", + "id": "diesel-f-w-14", + "title": "Diesel F/W 14", + "menu": "Diesel Fall/Winter 2014", "description": "FOR FALL/WINTER 2014, IN AN ACT OF DEFIANT ANONYMITY, DIESEL IS STRIPPING AWAY THE IDENTITIES OF ITS MODELS AND CAMPAIGN STARS, DEMOCRATIZING THE CONCEPT – THERE IS NO SINGULAR IDEA OF WHO THE DIESEL PERSON SHOULD BE. SHOT BY NICK KNIGHT, THE CREATIVE IS INSPIRED BY THE THEME “PICASSO MEETS AVEDON,” REPRESENTING THE NEXT DIMENSION OF DIESEL, INTRODUCING THE SECOND PHASE OF THE BRAND AFTER #DIESELREBOOT.", "video": { "url": "", @@ -76,44 +82,12 @@ }, "media": [ { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F38ea6ad0-f689-491f-857a-12d4fa0d4748.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F12184bdd-0aff-43db-882c-8efcb1e583de.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fb61bd44f-d074-4a20-a641-fc11957e8cd5.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F2a0b26ae-cc35-406e-923b-e60409e53eb8.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fd2a68db8-018b-4fdf-8f69-c2e4d0aff76a.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F0b24ebbd-07e8-446e-83db-60484f0f3dd9.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F1f8c6b75-c694-4d31-a790-b042b75b3606.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F907a0fbd-1455-4f3d-b28e-ebcba658f2d3.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F17ee7deb-dee5-497a-a8a6-dfe3f9c3105d.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fefd9dcf8-03c1-42c3-b6cc-3472acf908e4.jpg", "caption": "" } ], "thumbnail": { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F94c3bb9d-7d11-43f7-be86-5348a677845f.jpg", + "uri": "", "caption": "" }, "__index": "1" diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js index aae60b9..60f6528 100644 --- a/site/public/assets/javascripts/_env.js +++ b/site/public/assets/javascripts/_env.js @@ -431,13 +431,14 @@ function build_gallery () { }) gallery.on("cellSelect", function(){ + console.log("DUH") $caption.html( $(gallery.selectedElement).data("caption") ) videos.forEach(function(player){ player.api('pause') }) }) gallery.on("settle", function(){ - gallery && $caption.html( $(gallery.selectedElement).data("caption") ) + $caption.html( $(gallery.selectedElement).data("caption") ) }) gallery.on("staticClick", function(e){ // console.log(e) diff --git a/site/public/assets/javascripts/vendor/flickity.pkgd.js b/site/public/assets/javascripts/vendor/flickity.pkgd.js index 6389014..0471fa5 100644 --- a/site/public/assets/javascripts/vendor/flickity.pkgd.js +++ b/site/public/assets/javascripts/vendor/flickity.pkgd.js @@ -1,6 +1,10 @@ /*! - * Flickity PACKAGED v0.2.3 + * Flickity PACKAGED v1.0.1 * Touch, responsive, flickable galleries + * + * Licensed GPLv3 for open source use + * or Flickity Commercial License for commercial use + * * http://flickity.metafizzy.co * Copyright 2015 Metafizzy */ @@ -1176,7 +1180,7 @@ if ( typeof define === 'function' && define.amd ) { })( window ); /** - * matchesSelector v1.0.2 + * matchesSelector v1.0.3 * matchesSelector( element, '.selector' ) * MIT license */ @@ -1189,6 +1193,10 @@ if ( typeof define === 'function' && define.amd ) { var matchesMethod = ( function() { + // check for the standard method name first + if ( ElemProto.matches ) { + return 'matches'; + } // check un-prefixed if ( ElemProto.matchesSelector ) { return 'matchesSelector'; @@ -1280,7 +1288,7 @@ if ( typeof define === 'function' && define.amd ) { })( Element.prototype ); /** - * Fizzy UI utils v0.1.1 + * Fizzy UI utils v1.0.1 * MIT license */ @@ -1380,7 +1388,7 @@ utils.indexOf = Array.prototype.indexOf ? function( ary, obj ) { // ----- removeFrom ----- // -utils.removeFrom = function( obj, ary ) { +utils.removeFrom = function( ary, obj ) { var index = utils.indexOf( ary, obj ); if ( index != -1 ) { ary.splice( index, 1 ); @@ -1499,14 +1507,12 @@ utils.debounceMethod = function( _class, methodName, threshold ) { // ----- htmlInit ----- // -var jQuery = window.jQuery; - // http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ -function toDashed( str ) { +utils.toDashed = function( str ) { return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) { return $1 + '-' + $2; }).toLowerCase(); -} +}; var console = window.console; /** @@ -1516,7 +1522,7 @@ var console = window.console; */ utils.htmlInit = function( WidgetClass, namespace ) { docReady( function() { - var dashedNamespace = toDashed( namespace ); + var dashedNamespace = utils.toDashed( namespace ); var elems = document.querySelectorAll( '.js-' + dashedNamespace ); var dataAttr = 'data-' + dashedNamespace + '-options'; @@ -1538,6 +1544,7 @@ utils.htmlInit = function( WidgetClass, namespace ) { // initialize var instance = new WidgetClass( elem, options ); // make available via $().data('layoutname') + var jQuery = window.jQuery; if ( jQuery ) { jQuery.data( elem, namespace, instance ); } @@ -1893,8 +1900,12 @@ return proto; })); /*! - * Flickity v0.2.3 + * Flickity v1.0.1 * Touch, responsive, flickable galleries + * + * Licensed GPLv3 for open source use + * or Flickity Commercial License for commercial use + * * http://flickity.metafizzy.co * Copyright 2015 Metafizzy */ @@ -1999,7 +2010,8 @@ Flickity.defaults = { // initialIndex: 0, percentPosition: true, resize: true, - selectedAttraction: 0.025 + selectedAttraction: 0.025, + setGallerySize: true // watchCSS: false, // wrapAround: false }; @@ -2075,7 +2087,6 @@ Flickity.prototype.activate = function() { this.getSize(); // get cells from children this.reloadCells(); - this.setContainerSize(); if ( this.options.accessibility ) { // allow element to focusable @@ -2109,7 +2120,7 @@ Flickity.prototype.reloadCells = function() { this.cells = this._makeCells( this.slider.children ); this.positionCells(); this._getWrapShiftCells(); - this.setContainerSize(); + this.setGallerySize(); }; /** @@ -2215,8 +2226,10 @@ Flickity.prototype.setCellAlign = function() { this.cellAlign = shorthand ? shorthand[ this.originSide ] : this.options.cellAlign; }; -Flickity.prototype.setContainerSize = function() { - this.viewport.style.height = this.maxCellHeight + 'px'; +Flickity.prototype.setGallerySize = function() { + if ( this.options.setGallerySize ) { + this.viewport.style.height = this.maxCellHeight + 'px'; + } }; Flickity.prototype._getWrapShiftCells = function() { @@ -2267,13 +2280,21 @@ Flickity.prototype._containCells = function() { var lastCell = this.getLastCell(); var contentWidth = this.slideableWidth - lastCell.size[ endMargin ]; var endLimit = contentWidth - this.size.innerWidth * ( 1 - this.cellAlign ); + // content is less than gallery size + var isContentSmaller = contentWidth < this.size.innerWidth; // contain each cell target for ( var i=0, len = this.cells.length; i < len; i++ ) { var cell = this.cells[i]; // reset default target cell.setDefaultTarget(); - cell.target = Math.max( cell.target, this.cursorPosition + firstCellStartMargin ); - cell.target = Math.min( cell.target, endLimit ); + if ( isContentSmaller ) { + // all cells fit inside gallery + cell.target = contentWidth * this.cellAlign; + } else { + // contain to bounds + cell.target = Math.max( cell.target, this.cursorPosition + firstCellStartMargin ); + cell.target = Math.min( cell.target, endLimit ); + } } }; @@ -2293,7 +2314,7 @@ Flickity.prototype.dispatchEvent = function( type, event, args ) { if ( event ) { // create jQuery event var $event = jQuery.Event( event ); - $event.type = type + '.flickity'; + $event.type = type; this.$element.trigger( $event, args ); } else { // just trigger with type if no event available @@ -2330,7 +2351,7 @@ Flickity.prototype.select = function( index, isWrap ) { this.selectedIndex = index; this.setSelectedCell(); this.startAnimation(); - this.dispatchEvent('select'); + this.dispatchEvent('cellSelect'); } }; @@ -2448,7 +2469,7 @@ Flickity.prototype.resize = function() { } this.positionCells(); this._getWrapShiftCells(); - this.setContainerSize(); + this.setGallerySize(); this.positionSliderAtSelected(); }; @@ -2554,6 +2575,9 @@ Flickity.prototype.destroy = function() { eventie.unbind( window, 'resize', this ); } this.emit('destroy'); + if ( jQuery && this.$element ) { + jQuery.removeData( this.element, 'flickity' ); + } delete this.element.flickityGUID; delete instances[ this.guid ]; }; @@ -2599,7 +2623,7 @@ return Flickity; })); /*! - * Unipointer v0.1.0 + * Unipointer v1.1.0 * base class for doing one thing with pointer event * MIT license */ @@ -2736,7 +2760,7 @@ Unipointer.prototype._pointerDown = function( event, pointer ) { Unipointer.prototype.pointerDown = function( event, pointer ) { this._bindPostStartEvents( event ); - this.emitEvent( 'pointerDown', [ this, event, pointer ] ); + this.emitEvent( 'pointerDown', [ event, pointer ] ); }; // hash of events to be bound after start event @@ -2813,7 +2837,7 @@ Unipointer.prototype._pointerMove = function( event, pointer ) { // public Unipointer.prototype.pointerMove = function( event, pointer ) { - this.emitEvent( 'pointerMove', [ this, event, pointer ] ); + this.emitEvent( 'pointerMove', [ event, pointer ] ); }; // ----- end event ----- // @@ -2850,7 +2874,7 @@ Unipointer.prototype._pointerUp = function( event, pointer ) { // public Unipointer.prototype.pointerUp = function( event, pointer ) { - this.emitEvent( 'pointerUp', [ this, event, pointer ] ); + this.emitEvent( 'pointerUp', [ event, pointer ] ); }; // ----- pointer done ----- // @@ -2896,7 +2920,7 @@ Unipointer.prototype._pointerCancel = function( event, pointer ) { // public Unipointer.prototype.pointerCancel = function( event, pointer ) { - this.emitEvent( 'pointerCancel', [ this, event, pointer ] ); + this.emitEvent( 'pointerCancel', [ event, pointer ] ); }; // ----- ----- // @@ -2916,7 +2940,7 @@ return Unipointer; })); /*! - * Unidragger v0.2.0 + * Unidragger v1.1.3 * Draggable base class * MIT license */ @@ -3050,13 +3074,6 @@ var disableImgOndragstart = !isIE8 ? noop : function( handle ) { // ----- start event ----- // -var allowTouchstartNodes = Unidragger.allowTouchstartNodes = { - INPUT: true, - A: true, - BUTTON: true, - SELECT: true -}; - /** * pointer start * @param {Event} event @@ -3071,7 +3088,7 @@ Unidragger.prototype.pointerDown = function( event, pointer ) { } // bind move and end events this._bindPostStartEvents( event ); - this.emitEvent( 'pointerDown', [ this, event, pointer ] ); + this.emitEvent( 'pointerDown', [ event, pointer ] ); }; // base pointer down logic @@ -3079,11 +3096,10 @@ Unidragger.prototype._dragPointerDown = function( event, pointer ) { // track to see when dragging starts this.pointerDownPoint = Unipointer.getPointerPoint( pointer ); + // prevent default, unless touchstart or <select> + var isTouchstart = event.type == 'touchstart'; var targetNodeName = event.target.nodeName; - // HACK iOS, allow clicks on buttons, inputs, and links - var isTouchstartNode = event.type == 'touchstart' && allowTouchstartNodes[ targetNodeName ]; - // do not prevent default on touchstart nodes or <select> - if ( !isTouchstartNode && targetNodeName != 'SELECT' ) { + if ( !isTouchstart && targetNodeName != 'SELECT' ) { preventDefaultEvent( event ); } }; @@ -3097,7 +3113,7 @@ Unidragger.prototype._dragPointerDown = function( event, pointer ) { */ Unidragger.prototype.pointerMove = function( event, pointer ) { var moveVector = this._dragPointerMove( event, pointer ); - this.emitEvent( 'pointerMove', [ this, event, pointer, moveVector ] ); + this.emitEvent( 'pointerMove', [ event, pointer, moveVector ] ); this._dragMove( event, pointer, moveVector ); }; @@ -3129,7 +3145,7 @@ Unidragger.prototype.hasDragStarted = function( moveVector ) { * @param {Event or Touch} pointer */ Unidragger.prototype.pointerUp = function( event, pointer ) { - this.emitEvent( 'pointerUp', [ this, event, pointer ] ); + this.emitEvent( 'pointerUp', [ event, pointer ] ); this._dragPointerUp( event, pointer ); }; @@ -3155,7 +3171,7 @@ Unidragger.prototype._dragStart = function( event, pointer ) { }; Unidragger.prototype.dragStart = function( event, pointer ) { - this.emitEvent( 'dragStart', [ this, event, pointer ] ); + this.emitEvent( 'dragStart', [ event, pointer ] ); }; // dragMove @@ -3169,7 +3185,8 @@ Unidragger.prototype._dragMove = function( event, pointer, moveVector ) { }; Unidragger.prototype.dragMove = function( event, pointer, moveVector ) { - this.emitEvent( 'dragMove', [ this, event, pointer, moveVector ] ); + preventDefaultEvent( event ); + this.emitEvent( 'dragMove', [ event, pointer, moveVector ] ); }; // dragEnd @@ -3186,7 +3203,7 @@ Unidragger.prototype._dragEnd = function( event, pointer ) { }; Unidragger.prototype.dragEnd = function( event, pointer ) { - this.emitEvent( 'dragEnd', [ this, event, pointer ] ); + this.emitEvent( 'dragEnd', [ event, pointer ] ); }; // ----- onclick ----- // @@ -3202,15 +3219,16 @@ Unidragger.prototype.onclick = function( event ) { // triggered after pointer down & up with no/tiny movement Unidragger.prototype._staticClick = function( event, pointer ) { - // allow click in text input - if ( event.target.nodeName == 'INPUT' && event.target.type == 'text' ) { + // allow click in <input>s and <textarea>s + var nodeName = event.target.nodeName; + if ( nodeName == 'INPUT' || nodeName == 'TEXTAREA' ) { event.target.focus(); } this.staticClick( event, pointer ); }; Unidragger.prototype.staticClick = function( event, pointer ) { - this.emitEvent( 'staticClick', [ this, event, pointer ] ); + this.emitEvent( 'staticClick', [ event, pointer ] ); }; // ----- ----- // @@ -3325,10 +3343,6 @@ proto.unbindDrag = function() { delete this.isDragBound; }; -proto.hasDragStarted = function( moveVector ) { - return Math.abs( moveVector.x ) > 3; -}; - proto._uiChangeDrag = function() { delete this.isFreeScrolling; }; @@ -3345,7 +3359,9 @@ proto.pointerDown = function( event, pointer ) { // kludge to blur focused inputs in dragger var focused = document.activeElement; - if ( focused && focused.blur && focused != this.element ) { + if ( focused && focused.blur && focused != this.element && + // do not blur body for IE9 & 10, #117 + focused != document.body ) { focused.blur(); } this.pointerDownFocus( event ); @@ -3375,6 +3391,8 @@ proto.pointerDownFocus = function( event ) { } }; +// ----- move ----- // + proto.pointerMove = function( event, pointer ) { var moveVector = this._dragPointerMove( event, pointer ); this.touchVerticalScrollMove( event, pointer, moveVector ); @@ -3382,6 +3400,12 @@ proto.pointerMove = function( event, pointer ) { this.dispatchEvent( 'pointerMove', event, [ pointer, moveVector ] ); }; +proto.hasDragStarted = function( moveVector ) { + return !this.isTouchScrolling && Math.abs( moveVector.x ) > 3; +}; + +// ----- up ----- // + proto.pointerUp = function( event, pointer ) { delete this.isTouchScrolling; classie.remove( this.viewport, 'is-pointer-down' ); @@ -3405,11 +3429,16 @@ function getPointerWindowY( pointer ) { } proto.touchVerticalScrollMove = function( event, pointer, moveVector ) { - if ( !this.options.touchVerticalScroll || !touchScrollEvents[ event.type ] ) { + // do not scroll if already dragging, if disabled + var touchVerticalScroll = this.options.touchVerticalScroll; + // if touchVerticalScroll is 'withDrag', allow scrolling and dragging + var canNotScroll = touchVerticalScroll == 'withDrag' ? !touchVerticalScroll : + this.isDragging || !touchVerticalScroll; + if ( canNotScroll || !touchScrollEvents[ event.type ] ) { return; } - // don't start vertical scrolling until pointer has moved 16 pixels in a direction - if ( !this.isTouchScrolling && Math.abs( moveVector.y ) > 16 ) { + // don't start vertical scrolling until pointer has moved 10 pixels in a direction + if ( !this.isTouchScrolling && Math.abs( moveVector.y ) > 10 ) { // start touch vertical scrolling // scroll & pointerY when started this.startScrollY = window.pageYOffset; @@ -3417,13 +3446,6 @@ proto.touchVerticalScrollMove = function( event, pointer, moveVector ) { // start scroll animation this.isTouchScrolling = true; } - if ( !this.isTouchScrolling ) { - return; - } - // scroll window - var scrollDelta = this.pointerWindowStartY - getPointerWindowY( pointer ); - var scrollY = this.startScrollY + scrollDelta; - window.scroll( window.pageXOffset, scrollY ); }; // -------------------------- dragging -------------------------- // @@ -3435,6 +3457,8 @@ proto.dragStart = function( event, pointer ) { }; proto.dragMove = function( event, pointer, moveVector ) { + preventDefaultEvent( event ); + this.previousDragX = this.x; var movedX = moveVector.x; @@ -3584,11 +3608,9 @@ proto.dragEndBoostSelect = function() { proto.staticClick = function( event, pointer ) { // get clickedCell, if cell was clicked var clickedCell = this.getParentCell( event.target ); - var clickedCellIndex = clickedCell && - utils.indexOf( this.cells, clickedCell ); - var clickedCellElem = clickedCell && clickedCell.element; - this.dispatchEvent( 'staticClick', event, - [ pointer, clickedCellIndex, clickedCellElem ] ); + var cellElem = clickedCell && clickedCell.element; + var cellIndex = clickedCell && utils.indexOf( this.cells, clickedCell ); + this.dispatchEvent( 'staticClick', event, [ pointer, cellElem, cellIndex ] ); }; // ----- ----- // @@ -3602,7 +3624,7 @@ return Flickity; })); /*! - * Tap listener v0.1.0 + * Tap listener v1.1.0 * listens to taps * MIT license */ @@ -3688,7 +3710,7 @@ TapListener.prototype.pointerUp = function( event, pointer ) { pointerPoint.y <= boundingRect.bottom + scrollY; // trigger callback if pointer is inside element if ( isInside ) { - this.emitEvent( 'tap', [ this, event, pointer ] ); + this.emitEvent( 'tap', [ event, pointer ] ); } }; @@ -3797,10 +3819,10 @@ PrevNextButton.prototype._create = function() { } // update on select var _this = this; - this.onselect = function() { + this.onCellSelect = function() { _this.update(); }; - this.parent.on( 'select', this.onselect ); + this.parent.on( 'cellSelect', this.onCellSelect ); // tap this.on( 'tap', this.onTap ); // pointerDown @@ -3906,8 +3928,8 @@ PrevNextButton.prototype.destroy = function() { utils.extend( Flickity.defaults, { prevNextButtons: true, - leftArrowText: '‹', - rightArrowText: '›' + leftArrowText: '‹', + rightArrowText: '›' }); Flickity.createMethods.push('_createPrevNextButtons'); @@ -4000,10 +4022,10 @@ PageDots.prototype._create = function() { this.dots = []; // update on select var _this = this; - this.onselect = function() { + this.onCellSelect = function() { _this.updateSelected(); }; - this.parent.on( 'select', this.onselect ); + this.parent.on( 'cellSelect', this.onCellSelect ); // tap this.on( 'tap', this.onTap ); // pointerDown @@ -4073,7 +4095,7 @@ PageDots.prototype.updateSelected = function() { this.selectedDot.className = 'dot is-selected'; }; -PageDots.prototype.onTap = function( instance, event ) { +PageDots.prototype.onTap = function( event ) { var target = event.target; // only care about dot clicks if ( target.nodeName != 'LI' ) { @@ -4430,7 +4452,7 @@ Flickity.prototype.remove = function( elems ) { cell = cells[i]; cell.remove(); // remove item from collection - utils.removeFrom( cell, this.cells ); + utils.removeFrom( this.cells, cell ); } if ( cells.length ) { @@ -4479,7 +4501,7 @@ Flickity.prototype.cellChange = function( changedCellIndex ) { this._positionCells( changedCellIndex ); this._getWrapShiftCells(); - this.setContainerSize(); + this.setGallerySize(); // position slider if ( this.options.freeScroll ) { this.positionSlider(); @@ -4532,7 +4554,7 @@ return Flickity; }); /*! - * Flickity asNavFor v0.1.1 + * Flickity asNavFor v1.0.1 * enable asNavFor for Flickity */ @@ -4556,7 +4578,7 @@ return Flickity; // CommonJS module.exports = factory( window, - require('dessandro-classie'), + require('desandro-classie'), require('flickity'), require('fizzy-ui-utils') ); @@ -4610,7 +4632,7 @@ Flickity.prototype.setNavCompanion = function( elem ) { this.onNavCompanionSelect = function() { _this.navCompanionSelect(); }; - companion.on( 'select', this.onNavCompanionSelect ); + companion.on( 'cellSelect', this.onNavCompanionSelect ); // click this.on( 'staticClick', this.onNavStaticClick ); @@ -4645,9 +4667,9 @@ Flickity.prototype.removeNavSelectedElement = function() { delete this.navSelectedElement; }; -Flickity.prototype.onNavStaticClick = function( event, pointer, clickedCellIndex ) { - if ( typeof clickedCellIndex == 'number' ) { - this.navCompanion.select( clickedCellIndex ); +Flickity.prototype.onNavStaticClick = function( event, pointer, cellElement, cellIndex ) { + if ( typeof cellIndex == 'number' ) { + this.navCompanion.select( cellIndex ); } }; @@ -4659,7 +4681,7 @@ Flickity.prototype.destroyAsNavFor = function() { if ( !this.navCompanion ) { return; } - this.navCompanion.off( 'select', this.onNavCompanionSelect ); + this.navCompanion.off( 'cellSelect', this.onNavCompanionSelect ); this.off( 'staticClick', this.onNavStaticClick ); delete this.navCompanion; }; @@ -5007,7 +5029,7 @@ function makeArray( obj ) { }); /*! - * Flickity imagesLoaded v0.1.2 + * Flickity imagesLoaded v1.0.0 * enables imagesLoaded option for Flickity */ @@ -5022,30 +5044,27 @@ function makeArray( obj ) { // AMD define( [ 'flickity/js/index', - 'imagesloaded/imagesloaded', - 'fizzy-ui-utils/utils' - ], function( Flickity, imagesLoaded, utils ) { - return factory( window, Flickity, imagesLoaded, utils ); + 'imagesloaded/imagesloaded' + ], function( Flickity, imagesLoaded ) { + return factory( window, Flickity, imagesLoaded ); }); } else if ( typeof exports == 'object' ) { // CommonJS module.exports = factory( window, require('flickity'), - require('imagesloaded'), - require('fizzy-ui-utils') + require('imagesloaded') ); } else { // browser global window.Flickity = factory( window, window.Flickity, - window.imagesLoaded, - window.fizzyUIUtils + window.imagesLoaded ); } -}( window, function factory( window, Flickity, imagesLoaded, utils ) { +}( window, function factory( window, Flickity, imagesLoaded ) { Flickity.createMethods.push('_createImagesLoaded'); @@ -5060,12 +5079,8 @@ Flickity.prototype.imagesLoaded = function() { } var _this = this; function onImagesLoadedProgress( instance, image ) { - // check if image is a cell - var cell = _this.getCell( image.img ); - // otherwise get its parents - var cellElem = cell && cell.element || - utils.getParent( image.img, '.flickity-slider > *' ); - _this.cellSizeChange( cellElem ); + var cell = _this.getParentCell( image.img ); + _this.cellSizeChange( cell && cell.element ); } this.loader = imagesLoaded( this.slider ).on( 'progress', onImagesLoadedProgress ); }; diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js index c1f9dc8..2667ce6 100644 --- a/themes/okadmin/public/js/app.js +++ b/themes/okadmin/public/js/app.js @@ -59,7 +59,6 @@ var OKAdmin = function(){ uploader.bind( this ) uploader.add = function(url){ console.log(url) - console.log($el) $el.find(".uri").val(url) $el.find(".caption").val("") $el.find("img").attr("src", url).show() |
