Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
feat(slider): add full-featured slider component
Browse files Browse the repository at this point in the history
Closes #260. Closes #245. Closes #221. Closes #160. Closes #36.
Closes #31. Closes #21. Closes #255.
  • Loading branch information
ajoslin committed Sep 16, 2014
1 parent 5f5435d commit 5ea4dbc
Show file tree
Hide file tree
Showing 9 changed files with 691 additions and 207 deletions.
1 change: 0 additions & 1 deletion docs/templates/demo/template.index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<head>
<meta name="viewport" content="initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" href="/demo.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.18/angular.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.18/angular-animate.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.18/angular-route.min.js"></script>
Expand Down
5 changes: 5 additions & 0 deletions src/base/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
transition-delay: $val;
}

@mixin animation($val) {
-webkit-animation: $val;
animation: $val;
}

@mixin user-select($val:none) {
-webkit-user-select: $val;
-moz-user-select: $val;
Expand Down
31 changes: 31 additions & 0 deletions src/base/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,38 @@ var Util = {
return target;
}

},

// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
debounce: function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
clearTimeout(timeout);
timeout = setTimeout(function() {
timeout = null;
if (!immediate) func.apply(context, args);
}, wait);
if (immediate && !timeout) func.apply(context, args);
};
}


};

/*
* Since removing jQuery from the demos, some code that uses `element.focus()` is broken.
*
* We need to add `element.focus()`, because it's testable unlike `element[0].focus`.
*
* TODO(ajoslin): This should be added in a better place later.
*/
angular.element.prototype.focus = angular.element.prototype.focus || function() {
if (this.length) {
this[0].focus();
}
return this;
};
Loading

0 comments on commit 5ea4dbc

Please sign in to comment.