Giter VIP home page Giter VIP logo

input-spinner's Introduction

input-spinner's People

Contributors

fizista avatar humancopy avatar kix avatar samwatkinson1 avatar twistedlogic avatar vsn4ik avatar xixilive avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

input-spinner's Issues

general

hmmm idea good, execution not that good.
plugin is not unobtrusive which complicates everything A LOT
plugin throws null exceptions (okay, if not called on parent of input) but still if it would be unobtrusive no need to call it on parent - no exceptions - always call on element itself,...
Next Problem - if input field doesn't have attribute type="text" - plugin throughs error. The default type of an input is text though should also work with not explicitly writing the attribute.

so issue is - please redesign code ;-)

Currency - Not a bug

I need to change the currency:
(,) to decimal separator and (.) to thousands separator
Is that possible?

Why is input type text, why not number for hours and other numeric items

Hi, I am using the hours version and noticed the control has been configure with input type as text.

I am binding and onchange, and finding that the input box is allowing text and creating problem for me.

So, I want to set it such that it does not allow text out numbers and decimals for hour - is this possible?

does setting it type=number break with jquery 3.2?

thanks

Add destroy method

When i'm trying to use spinner via several ajax requests to the same input, i can use only the first response data. I think it because of function call:

$(function() {
    $('[data-trigger="spinner"]').spinner();
  });

And destroy method should help with it.

Don't show on forms ( style="/* display: none; */")

I am using spinner with bootstrap 3.3.5 and jquery 1.11.3
my code

<div class="input-group spinner" id="spinner" data-trigger="spinner" style="/* display: none; */">
  <input type="text" id="orderid" value="1" name="orderid" data-rule="quantity" class="form-control">
  <span class="input-group-addon">
    <a href="javascript:;" class="spin-up" data-spin="up">
    <span class="glyphicon glyphicon-triangle-top"></span>
    </a>
    <a href="javascript:;" class="spin-down" data-spin="down">
    <span class="glyphicon glyphicon-triangle-bottom"></span>
    </a>
  </span>
</div>

What sets the display: none ???

I am using

  $(function(){
    $("#spinner").spinner("changing", function(e, newVal, oldVal){
      $("#orderid").val(newVal);
    });
  });
  $("#spinner").show();

to show it on my form

Is it the right way ?? Please, guide me.

Spinner doesn't stop

There is a bug with the spinner where if you click the arrows up/down and drag them to the outside, the spinner continuously spins and you can't make it stop.
I thought that it might be because the up/down arrow buttons don't lose the focus state, so I tried to blur them on mouseout but it didn't work.

Potential memory leak when removing elements from the DOM

During testing, I've noticed that Chrome memory heap dumps show that when spinners are added then removed from the DOM their events leak and persist in the memory. This can cause slow downs over time in older browsers, e.g. IE11.

I tested this by adding 1000 individual instances of the spinners to the DOM then removing them with the jQuery .remove() method. The heap stack then shows thousands of instances of Detached elements, e.g. 2000 of those being HTMLDivElements that are still bound to a "mouseup" event.

I think this can be solved by adding a form of a destroy event that will handle purging event handlers.

Rails turbolinks 支持有问题?

启用 Rails turbolinks 之后,从其他页面的点击进入包含 spinner 功能的页面中,点击 + 或 -,加减有时是 2,3,4等的,单击事件被执行了多次,请问如何处理?? ?

Delay before continuous change

It is very difficult to change only one step by clicking arrows. Generally it changes two values. This needs a delay before changing values continuously. Also would be nice an option disable continuous change as well as mentioned #1

only click

how to make only a click? without clamping

cannot set parameters repetitively

Hi all,
I used jquery-spinner in my company project and just found it cannot support setting parameters repetitively. I.e., if i set the input attributes such as data-max = "100", data-min="1", data-step="1" in the html page , and then change it through jquery using $("#spinner").attr("data-max", 10); $("#spinner").attr("data-min", 1); $("#spinner").attr("data-step", 0.1); then it just didnot work. Is there anything wrong with my code? Or is it simply a bug in the project?

Thanks

添加JS效果

在我的购物车中添加购物车数量加减的效果,修改页面的样式

Custom lists

I'm working on a project where we need to accept entry of exam grades in two different grade systems... one where the grades are one of A*, A, B, C, D, E and one which the grades are A, B, C, D, E.

This leads me to think that the ability for the plugin to accept a list of labels and values in JSON form - e.g. {{'A_',50},{'A',40},{'B_',40},{'C',30},{'D*',20},{'E',10}} (or square bracketed equivalent syntax) - would address this requirement and allow the spinner to be used in many other similar situations where there is a list of values to choose from but a dropdown isn't appropriate.

The parameters Min, Max, Step and Precision would need to be ignored and in addition to a means of specifying the list itself I suggest that two new parameters would be required - one to control whether the spinner loops round the list, and one to specify what the null (unselected) value should be (if any), which in my case I would want it to be "-", for example.

Would you consider adding this feature set?

Make package public

You have your package.json set to private. Can you remove this and publish so people can integrate this in their package managers.

Thanks!

Changed event is not triggered on pressing enter for default value.

Hi, I am facing issue, with enter event on text box for default value. For reference my text box is

<input type="text" class="form-control " data-max="20" data-min="0" data-step="0.1" value="10" data-rule="currency">

and i have bind the "changed" event. It's working fine if changed the value from 10 to 15 and 15 to 16. Now problem is when I changed the text box value from 16 to 10 and pressing enter without loosing the focus changed event is not getting fired.

I have debugged the library and found at line number 96 : this.oldValue is still 10 even i have updated the text box value from 10 to 15 to 16.

Please check and update the library if needed.

Thanks

mouseup event issue

I use mousedown events other input form(ex: detepicker).
Spinner "beginSpin" event can't stop after other form mouse event is activated.
The problem was solved with code change.↓

 this.$el 
      .on('click.spinner', '[data-spin="up"], [data-spin="down"]', $.proxy(this, 'spin')) 
      .on('mousedown.spinner', '[data-spin="up"], [data-spin="down"]', $.proxy(this, 'spin')); 
 $(document).on('mouseup.spinner', $.proxy(function() { 
      clearTimeout(this.spinTimeout); 
      clearInterval(this.spinInterval); 
 }, this)); 

 this.$el 
      .on('click.spinner', '[data-spin="up"], [data-spin="down"]', $.proxy(this, 'spin')) 
      .on('mousedown.spinner', '[data-spin="up"], [data-spin="down"]', $.proxy(this, 'spin')); 
      .on('mouseup.spinner', '[data-spin="up"], [data-spin="down"]', $.proxy(function() {
           clearTimeout(this.spinTimeout);
           clearInterval(this.spinInterval);
      }, this));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.