Skip to content

Commit

Permalink
define functions in order they are used
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Mar 29, 2017
1 parent 28e46da commit 1859435
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions dist/bespoke-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self);var o=n;o=o.bespoke||(o.bespoke={}),o=o.plugins||(o.plugins={}),o.hash=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
module.exports = function() {
return function(deck) {
var activateSlide = function(index) {
var indexToActivate = -1 < index && index < deck.slides.length ? index : 0;
if (indexToActivate !== deck.slide()) {
deck.slide(indexToActivate);
}
};

var parseHash = function() {
var hash = window.location.hash.slice(1),
slideNumberOrName = parseInt(hash, 10);
Expand All @@ -26,13 +33,6 @@ module.exports = function() {
}
};

var activateSlide = function(index) {
var indexToActivate = -1 < index && index < deck.slides.length ? index : 0;
if (indexToActivate !== deck.slide()) {
deck.slide(indexToActivate);
}
};

setTimeout(function() {
parseHash();

Expand Down
2 changes: 1 addition & 1 deletion dist/bespoke-hash.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions lib/bespoke-hash.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
module.exports = function() {
return function(deck) {
var activateSlide = function(index) {
var indexToActivate = -1 < index && index < deck.slides.length ? index : 0;
if (indexToActivate !== deck.slide()) {
deck.slide(indexToActivate);
}
};

var parseHash = function() {
var hash = window.location.hash.slice(1),
slideNumberOrName = parseInt(hash, 10);
Expand All @@ -17,13 +24,6 @@ module.exports = function() {
}
};

var activateSlide = function(index) {
var indexToActivate = -1 < index && index < deck.slides.length ? index : 0;
if (indexToActivate !== deck.slide()) {
deck.slide(indexToActivate);
}
};

setTimeout(function() {
parseHash();

Expand Down

0 comments on commit 1859435

Please sign in to comment.