Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

refactor: material-slider #255

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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