From ccd76dd0f785fd6d5ea1ebcd062cb92fd13ec4e8 Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Sun, 3 Jan 2016 09:46:20 -0500 Subject: [PATCH] Fixed comment --- dist/angular-flickity.js | 110 ++++++++++++++++++++++++++++++++++- dist/angular-flickity.js.map | 2 +- src/flickity.directive.js | 2 +- 3 files changed, 109 insertions(+), 5 deletions(-) diff --git a/dist/angular-flickity.js b/dist/angular-flickity.js index 2186a57..3cbb199 100644 --- a/dist/angular-flickity.js +++ b/dist/angular-flickity.js @@ -58,7 +58,11 @@ return /******/ (function(modules) { // webpackBootstrap var _flickity = __webpack_require__(1); - angular.module('bc.Flickity', []).directive('bcFlickity', _flickity.FlickityDirective); + var _flickityNext = __webpack_require__(2); + + var _flickityPrevious = __webpack_require__(3); + + angular.module('bc.Flickity', []).directive('bcFlickity', _flickity.FlickityDirective).directive('bcFlickityNext', _flickityNext.FlickityNextDirective).directive('bcFlickityPrevious', _flickityPrevious.FlickityPreviousDirective); /***/ }, /* 1 */ @@ -164,14 +168,114 @@ return /******/ (function(modules) { // webpackBootstrap // Initialize Flickity $timeout(function () { - new Flickity($element[0], flickityOptions); + vm.Flickity = new Flickity($element[0], flickityOptions); }); } /** * Controller */ - function FlickityController() {} + function FlickityController() { + + this.next = next; + this.previous = previous; + + /** + * Move to the next slide + */ + function next(isWrapped) { + this.Flickity.next(isWrapped); + } + + /** + * Move to the previous slide + */ + function previous(isWrapped) { + this.Flickity.previous(isWrapped); + } + } + } + +/***/ }, +/* 2 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FlickityNextDirective = FlickityNextDirective; + function FlickityNextDirective() { + 'ngInject'; + + var directive = { + restrict: 'A', + require: '^bcFlickity', + scope: { + bcFlickityNext: '=?' + }, + link: linkFunction + }; + + return directive; + + /** + * Link + */ + function linkFunction($scope, $element, $attrs, $ctrl) { + + // If no boolean was passed in, set to a default + if (typeof $scope.bcFlickityNext !== 'boolean') { + $scope.bcFlickityNext = true; + } + + // Bind the click up to the required controller + $element.on('click', function () { + $ctrl.next($scope.bcFlickityNext); + }); + } + } + +/***/ }, +/* 3 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FlickityPreviousDirective = FlickityPreviousDirective; + function FlickityPreviousDirective() { + 'ngInject'; + + var directive = { + restrict: 'A', + require: '^bcFlickity', + scope: { + bcFlickityPrevious: '=?' + }, + link: linkFunction + }; + + return directive; + + /** + * Link + */ + function linkFunction($scope, $element, $attrs, $ctrl) { + + // If no boolean was passed in, set to a default + if (typeof $scope.bcFlickityPrevious !== 'boolean') { + $scope.bcFlickityPrevious = true; + } + + // Bind the click up to the required controller + $element.on('click', function () { + $ctrl.previous($scope.bcFlickityPrevious); + }); + } } /***/ } diff --git a/dist/angular-flickity.js.map b/dist/angular-flickity.js.map index e6ab19e..63ea8d1 100644 --- a/dist/angular-flickity.js.map +++ b/dist/angular-flickity.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap b64db05dbd4d32eb87cf","webpack:///./src/index.js","webpack:///./src/flickity.directive.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;ACpCA,QAAO,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,CAAC,CAC5B,SAAS,CAAC,YAAY,YAHlB,iBAAiB,CAGqB,C;;;;;;;;;;;SCY/B,iBAAiB,GAAjB,iBAAiB;;;;;;;;;;;;;;;;AAA1B,UAAS,iBAAiB,CAC7B,QAAQ,EACV;AACE,eAAU,CAAC;;AAEX,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C,CAAC,CAAC;MAEN;;;;;AAMD,cAAS,kBAAkB,GAAG,EAE7B","file":"angular-flickity.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"angular-flickity\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"angular-flickity\"] = factory();\n\telse\n\t\troot[\"angular-flickity\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap b64db05dbd4d32eb87cf\n **/","import { FlickityDirective } from './flickity.directive';\n\nangular.module('bc.Flickity', [])\n .directive('bcFlickity', FlickityDirective)\n;\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./~/eslint-loader!./src/index.js\n **/","/* global Flickity */\n\n/**\n * Flickity.js\n * http://flickity.metafizzy.co/options.html\n *\n * Required markup\n *\n *
\n *
\n *
\n * ...\n *
\n *\n */\nexport function FlickityDirective(\n $timeout\n) {\n 'ngInject';\n\n const directive = {\n restrict: 'A',\n scope: {},\n bindToController: {\n flickityAccessibility: '=?',\n flickityAutoPlay: '=?',\n flickityCellAlign: '=?',\n flickityCellSelector: '=?',\n flickityContain: '=?',\n flickityDraggable: '=?',\n flickityFreeScroll: '=?',\n flickityFriction: '=?',\n flickityInitialIndex: '=?',\n flickityLazyLoad: '=?',\n flickityPercentPosition: '=?',\n flickityPrevNextButton: '=?',\n flickityArrowShape: '=?',\n flickityPageDots: '=?',\n flickityResize: '=?',\n flickityRightToLeft: '=?',\n flickitySetGallerySize: '=?',\n flickityWatchCss: '=?',\n flickityWrapAround: '=?',\n flickityImagesLoaded: '=?',\n flickityAsNavFor: '=?',\n flickitySelectedAttraction: '=?',\n flickityFreeScrollFriction: '=?',\n },\n link: linkFunction,\n controller: FlickityController,\n controllerAs: 'vm',\n };\n\n return directive;\n\n\n /**\n * Link\n */\n function linkFunction($scope, $element, $attrs, vm) {\n\n const defaultInitialIndex = 0;\n const defaultFriction = .2;\n const defaultCellAlign = 'center';\n\n // Define the option object using any user defined options while falling back to defaults\n const flickityOptions = {\n accessibility: angular.isDefined(vm.flickityAccessibility) ?\n vm.flickityAccessibility : true,\n autoPlay: angular.isDefined(vm.flickityAutoPlay) ?\n vm.flickityAutoPlay : false,\n cellAlign: angular.isDefined(vm.flickityCellAlign) ?\n vm.flickityCellAlign : defaultCellAlign,\n cellSelector: angular.isDefined(vm.flickityCellSelector) ?\n vm.flickityCellSelector : undefined,\n contain: angular.isDefined(vm.flickityContain) ?\n vm.flickityContain : false,\n draggable: angular.isDefined(vm.flickityDraggable) ?\n vm.flickityDraggable : true,\n freeScroll: angular.isDefined(vm.flickityFreeScroll) ?\n vm.flickityFreeScroll : false,\n freeScrollFriction: angular.isDefined(vm.flickityFreeScrollFriction) ?\n vm.flickityFreeScrollFriction : false,\n selectedAttraction: angular.isDefined(vm.flickitySelectedAttraction) ?\n vm.flickitySelectedAttraction : true,\n friction: angular.isDefined(vm.flickityFriction) ?\n vm.flickityFriction : defaultFriction,\n initialIndex: angular.isDefined(vm.flickityInitialIndex) ?\n vm.flickityInitialIndex : defaultInitialIndex,\n lazyLoad: angular.isDefined(vm.flickityLazyLoad) ?\n vm.flickityLazyLoad : true,\n percentPosition: angular.isDefined(vm.flickityPercentPosition) ?\n vm.flickityPercentPosition : true,\n prevNextButtons: angular.isDefined(vm.flickityPrevNextButton) ?\n vm.flickityPrevNextButton : true,\n pageDots: angular.isDefined(vm.flickityPageDots) ?\n vm.flickityPageDots : true,\n resize: angular.isDefined(vm.flickityResize) ?\n vm.flickityResize : true,\n rightToLeft: angular.isDefined(vm.flickityRightToLeft) ?\n vm.flickityRightToLeft : false,\n setGallerySize: angular.isDefined(vm.flickitySetGallerySize) ?\n vm.flickitySetGallerySize : true,\n watchCSS: angular.isDefined(vm.flickityWatchCss) ?\n vm.flickityWatchCss : false,\n wrapAround: angular.isDefined(vm.flickityWrapAround) ?\n vm.flickityWrapAround : false,\n imagesLoaded: angular.isDefined(vm.flickityImagesLoaded) ?\n vm.flickityImagesLoaded : true,\n asNavFor: angular.isDefined(vm.flickityAsNavFor) ?\n vm.flickityAsNavFor : true,\n };\n\n if (angular.isDefined(vm.flickityArrowShape)) {\n flickityOptions.arrowShape = vm.flickityArrowShape;\n }\n\n\n // Initialize Flickity\n $timeout(() => {\n new Flickity($element[0], flickityOptions);\n });\n\n }\n\n\n /**\n * Controller\n */\n function FlickityController() {\n\n }\n\n}\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./~/eslint-loader!./src/flickity.directive.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 1c4a6153ae8001e58dc2","webpack:///./src/index.js","webpack:///./src/flickity.directive.js","webpack:///./src/flickityNext.directive.js","webpack:///./src/flickityPrevious.directive.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C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,EAAE,MAAM,EAAE,KAAK,EAAE;;;AAGnD,aAAI,OAAO,MAAM,CAAC,cAAc,KAAK,SAAS,EAAE;AAC5C,mBAAM,CAAC,cAAc,GAAG,IAAI,CAAC;UAChC;;;AAGD,iBAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,YAAM;AACvB,kBAAK,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;UACrC,CAAC,CAAC;MAEN;;;;;;;;;;;;SC/BW,yBAAyB,GAAzB,yBAAyB;AAAlC,UAAS,yBAAyB,GACvC;AACE,eAAU,CAAC;;AAEX,SAAM,SAAS,GAAG;AACd,iBAAQ,EAAE,GAAG;AACb,gBAAO,EAAE,aAAa;AACtB,cAAK,EAAE;AACH,+BAAkB,EAAE,IAAI;UAC3B;AACD,aAAI,EAAE,YAAY;MACrB,CAAC;;AAEF,YAAO,SAAS;;;;;AAMhB,cAAS,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE;;;AAGnD,aAAI,OAAO,MAAM,CAAC,kBAAkB,KAAK,SAAS,EAAE;AAChD,mBAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC;UACpC;;;AAGD,iBAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,YAAM;AACvB,kBAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;UAC7C,CAAC,CAAC;MAEN","file":"angular-flickity.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"angular-flickity\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"angular-flickity\"] = factory();\n\telse\n\t\troot[\"angular-flickity\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 1c4a6153ae8001e58dc2\n **/","import { FlickityDirective } from './flickity.directive';\nimport { FlickityNextDirective } from './flickityNext.directive';\nimport { FlickityPreviousDirective } from './flickityPrevious.directive';\n\nangular.module('bc.Flickity', [])\n .directive('bcFlickity', FlickityDirective)\n .directive('bcFlickityNext', FlickityNextDirective)\n .directive('bcFlickityPrevious', FlickityPreviousDirective)\n;\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./~/eslint-loader!./src/index.js\n **/","/* global Flickity */\n\n/**\n * Flickity.js\n * http://flickity.metafizzy.co/options.html\n *\n * Required markup\n *\n *
\n *
\n *
\n * ...\n *
\n *\n */\nexport function FlickityDirective(\n $timeout\n) {\n 'ngInject';\n\n const directive = {\n restrict: 'A',\n scope: {},\n bindToController: {\n flickityAccessibility: '=?',\n flickityAutoPlay: '=?',\n flickityCellAlign: '=?',\n flickityCellSelector: '=?',\n flickityContain: '=?',\n flickityDraggable: '=?',\n flickityFreeScroll: '=?',\n flickityFriction: '=?',\n flickityInitialIndex: '=?',\n flickityLazyLoad: '=?',\n flickityPercentPosition: '=?',\n flickityPrevNextButton: '=?',\n flickityArrowShape: '=?',\n flickityPageDots: '=?',\n flickityResize: '=?',\n flickityRightToLeft: '=?',\n flickitySetGallerySize: '=?',\n flickityWatchCss: '=?',\n flickityWrapAround: '=?',\n flickityImagesLoaded: '=?',\n flickityAsNavFor: '=?',\n flickitySelectedAttraction: '=?',\n flickityFreeScrollFriction: '=?',\n },\n link: linkFunction,\n controller: FlickityController,\n controllerAs: 'vm',\n };\n\n return directive;\n\n\n /**\n * Link\n */\n function linkFunction($scope, $element, $attrs, vm) {\n\n const defaultInitialIndex = 0;\n const defaultFriction = .2;\n const defaultCellAlign = 'center';\n\n // Define the option object using any user defined options while falling back to defaults\n const flickityOptions = {\n accessibility: angular.isDefined(vm.flickityAccessibility) ?\n vm.flickityAccessibility : true,\n autoPlay: angular.isDefined(vm.flickityAutoPlay) ?\n vm.flickityAutoPlay : false,\n cellAlign: angular.isDefined(vm.flickityCellAlign) ?\n vm.flickityCellAlign : defaultCellAlign,\n cellSelector: angular.isDefined(vm.flickityCellSelector) ?\n vm.flickityCellSelector : undefined,\n contain: angular.isDefined(vm.flickityContain) ?\n vm.flickityContain : false,\n draggable: angular.isDefined(vm.flickityDraggable) ?\n vm.flickityDraggable : true,\n freeScroll: angular.isDefined(vm.flickityFreeScroll) ?\n vm.flickityFreeScroll : false,\n freeScrollFriction: angular.isDefined(vm.flickityFreeScrollFriction) ?\n vm.flickityFreeScrollFriction : false,\n selectedAttraction: angular.isDefined(vm.flickitySelectedAttraction) ?\n vm.flickitySelectedAttraction : true,\n friction: angular.isDefined(vm.flickityFriction) ?\n vm.flickityFriction : defaultFriction,\n initialIndex: angular.isDefined(vm.flickityInitialIndex) ?\n vm.flickityInitialIndex : defaultInitialIndex,\n lazyLoad: angular.isDefined(vm.flickityLazyLoad) ?\n vm.flickityLazyLoad : true,\n percentPosition: angular.isDefined(vm.flickityPercentPosition) ?\n vm.flickityPercentPosition : true,\n prevNextButtons: angular.isDefined(vm.flickityPrevNextButton) ?\n vm.flickityPrevNextButton : true,\n pageDots: angular.isDefined(vm.flickityPageDots) ?\n vm.flickityPageDots : true,\n resize: angular.isDefined(vm.flickityResize) ?\n vm.flickityResize : true,\n rightToLeft: angular.isDefined(vm.flickityRightToLeft) ?\n vm.flickityRightToLeft : false,\n setGallerySize: angular.isDefined(vm.flickitySetGallerySize) ?\n vm.flickitySetGallerySize : true,\n watchCSS: angular.isDefined(vm.flickityWatchCss) ?\n vm.flickityWatchCss : false,\n wrapAround: angular.isDefined(vm.flickityWrapAround) ?\n vm.flickityWrapAround : false,\n imagesLoaded: angular.isDefined(vm.flickityImagesLoaded) ?\n vm.flickityImagesLoaded : true,\n asNavFor: angular.isDefined(vm.flickityAsNavFor) ?\n vm.flickityAsNavFor : true,\n };\n\n if (angular.isDefined(vm.flickityArrowShape)) {\n flickityOptions.arrowShape = vm.flickityArrowShape;\n }\n\n\n // Initialize Flickity\n $timeout(() => {\n vm.Flickity = new Flickity($element[0], flickityOptions);\n });\n\n }\n\n\n /**\n * Controller\n */\n function FlickityController() {\n\n this.next = next;\n this.previous = previous;\n\n\n\n\n /**\n * Move to the next slide\n */\n function next(isWrapped) {\n this.Flickity.next(isWrapped);\n }\n\n\n /**\n * Move to the previous slide\n */\n function previous(isWrapped) {\n this.Flickity.previous(isWrapped);\n }\n\n }\n\n}\n\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./~/eslint-loader!./src/flickity.directive.js\n **/","export function FlickityNextDirective(\n) {\n 'ngInject';\n\n const directive = {\n restrict: 'A',\n require: '^bcFlickity',\n scope: {\n bcFlickityNext: '=?',\n },\n link: linkFunction,\n };\n\n return directive;\n\n\n /**\n * Link\n */\n function linkFunction($scope, $element, $attrs, $ctrl) {\n\n // If no boolean was passed in, set to a default\n if (typeof $scope.bcFlickityNext !== 'boolean') {\n $scope.bcFlickityNext = true;\n }\n\n // Bind the click up to the required controller\n $element.on('click', () => {\n $ctrl.next($scope.bcFlickityNext);\n });\n\n }\n\n\n\n}\n\n\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./~/eslint-loader!./src/flickityNext.directive.js\n **/","export function FlickityPreviousDirective(\n) {\n 'ngInject';\n\n const directive = {\n restrict: 'A',\n require: '^bcFlickity',\n scope: {\n bcFlickityPrevious: '=?',\n },\n link: linkFunction,\n };\n\n return directive;\n\n\n /**\n * Link\n */\n function linkFunction($scope, $element, $attrs, $ctrl) {\n\n // If no boolean was passed in, set to a default\n if (typeof $scope.bcFlickityPrevious !== 'boolean') {\n $scope.bcFlickityPrevious = true;\n }\n\n // Bind the click up to the required controller\n $element.on('click', () => {\n $ctrl.previous($scope.bcFlickityPrevious);\n });\n\n }\n\n\n\n}\n\n\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./~/eslint-loader!./src/flickityPrevious.directive.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/src/flickity.directive.js b/src/flickity.directive.js index 5f87eed..4247e8d 100644 --- a/src/flickity.directive.js +++ b/src/flickity.directive.js @@ -144,7 +144,7 @@ export function FlickityDirective( /** - * Move to the next slide + * Move to the previous slide */ function previous(isWrapped) { this.Flickity.previous(isWrapped);