summaryrefslogtreecommitdiff
path: root/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.number_picker.js
diff options
context:
space:
mode:
authorDougal Matthews <dougal@redhat.com>2016-01-21 15:12:37 +0000
committerDougal Matthews <dougal@redhat.com>2016-01-22 11:26:13 +0000
commit31e0bb84f6a412777a69781d1e6438b56a28c64b (patch)
treeab01e5cb768eb3aaafde357c9ade50976c202d0a /tuskar_ui/infrastructure/static/infrastructure/js/tuskar.number_picker.js
parent0a5b41bad6424fa1bef17bdbb964867832d2bdfb (diff)
downloadtuskar-ui-31e0bb84f6a412777a69781d1e6438b56a28c64b.tar.gz
Retire the Tuskar UI codebase
Change-Id: I469fdc1339d4991586bf2e1d62d99fd5b68289eb Depends-On: I904b2f27591333e104bf9080bb8c3876fcb3596c
Diffstat (limited to 'tuskar_ui/infrastructure/static/infrastructure/js/tuskar.number_picker.js')
-rw-r--r--tuskar_ui/infrastructure/static/infrastructure/js/tuskar.number_picker.js51
1 files changed, 0 insertions, 51 deletions
diff --git a/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.number_picker.js b/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.number_picker.js
deleted file mode 100644
index ac6ffda0..00000000
--- a/tuskar_ui/infrastructure/static/infrastructure/js/tuskar.number_picker.js
+++ /dev/null
@@ -1,51 +0,0 @@
-tuskar.number_picker = (function () {
- 'use strict';
-
- var module = {};
-
- module.init = function () {
- $('input.number-picker').removeClass(
- 'form-control').wrap(
- '<div class="number_picker unselectable form-control">').before(
- '<a class="arrow-left" href="#">' +
- '<i class="fa fa-chevron-left"></i></a>').after(
- '<a class="arrow-right" href="#">' +
- '<i class="fa fa-chevron-right"></i></a>').each(
- function () {
- var $this = $(this);
- var $right_arrow = $this.next('a.arrow-right');
- var $left_arrow = $this.prev('a.arrow-left');
- if ($this.attr('readonly')) {
- $this.parent().addClass('readonly');
- }
- function change(step) {
- var value = +$this.val();
- var maximum = +$this.attr('max');
- var minimum = +$this.attr('min');
- value += step;
- if (!isNaN(maximum)) { value = Math.min(maximum, value); }
- if (!isNaN(minimum)) { value = Math.max(minimum, value); }
- $right_arrow.toggleClass('disabled', (value === maximum));
- $left_arrow.toggleClass('disabled', (value === minimum));
- $this.val(value);
- $this.trigger('change');
- }
- $right_arrow.click(function () {
- var step = +($this.attr('step') || 1);
- change(step);
- });
- $left_arrow.click(function () {
- var step = -($this.attr('step') || 1);
- change(step);
- });
- change(0);
- var step = +($this.attr('step') || 1);
- if (step !== 1) {
- $this.after('<span class="step">+' + step + '</span>');
- }
- });
- };
-
- horizon.addInitFunction(module.init);
- return module;
-} ());