Last active
September 5, 2021 17:32
-
-
Save skelet00r/b20160fced5963a338ab to your computer and use it in GitHub Desktop.
Revisions
-
James Delibas revised this gist
Mar 31, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ app.directive('spin', function() { input.TouchSpin({ min: min, max: max, step: parseInt(step), initval: initial, forcestepdivisibility : 'none', booster : false -
James Delibas revised this gist
Mar 31, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ app.directive('spin', function() { input.TouchSpin({ min: min, max: max, step: step, initval: initial, forcestepdivisibility : 'none', booster : false -
James Delibas revised this gist
Mar 31, 2016 . 1 changed file with 21 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ MIT License Copyright (c) [2016] [James Delibas] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -
James Delibas created this gist
Oct 29, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ <html> <body> //Note the value attribute rather than ng-model <spin value="someScopeValue" min="1" max="{{someOtherScopeValue}}" step="2" /> $scope.someScopeValue = 2; $scope.someOtherScopeValue = 20; </body> </html> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ app.directive('spin', function() { return { templateUrl: 'spinner.html', scope: { 'value' : "=" }, restrict: 'E', link: function(scope, element, attrs, ngModel) { var min,max,step,value,input,initial; element = angular.element(element); if(typeof attrs === 'undefined'){ throw new Error('Spin.js attributes missing'); } else { min = typeof attrs.min !== 'undefined' ? attrs.min : 0; max = typeof attrs.max !== 'undefined' ? attrs.max : 999; step = typeof attrs.step !== 'undefined' ? attrs.step : 1; initial = parseInt(scope.value); input = $("input[name='spin']",element); input.TouchSpin({ min: min, max: max, stepinterval: step, initval: initial, forcestepdivisibility : 'none', booster : false }); input.on('change', function(e){ scope.value = input.val(); //hack if(!scope.$$phase) { scope.$apply(); } }); } } }; }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ <input type="text" name="spin" class="form-control spinner-input">