Giter Site home page Giter Site logo

Remove jQuery UI dependency about ui-slider HOT 24 CLOSED

j8 avatar j8 commented on September 15, 2024
Remove jQuery UI dependency

from ui-slider.

Comments (24)

douglasduteil avatar douglasduteil commented on September 15, 2024

Agreed
@ProLoser I'm working on a fork to drop this dependence.

from ui-slider.

douglasduteil avatar douglasduteil commented on September 15, 2024

Just saying that I didn't drop the issue
I have a early version here

from ui-slider.

douglasduteil avatar douglasduteil commented on September 15, 2024

Update : http://plnkr.co/guRVnr

  • Change position parsing
  • Add style example
  • Observe max and min attributes

from ui-slider.

douglasduteil avatar douglasduteil commented on September 15, 2024

K I'm releasing a early version

from ui-slider.

j8 avatar j8 commented on September 15, 2024

@douglasduteil Extremely great work, can't wait to get handson with the early version. Don't forget the callbacks, especially onRelease, as it will be critical for inline editing application and promises. Also I can give a hand for the mobile version of this, if needed.

from ui-slider.

douglasduteil avatar douglasduteil commented on September 15, 2024

K @j8 I wasn't happy about the templating system in this directive. So I made a verbose version of it.
Before :

<ui-slider></ui-slider>

After

<ui-slider class="ui-slider-default">
  <slider-track>
    <slider-thumb ng-model="_"/>
  </slider-track>
</ui-slider>

The thumb is now customizable and the value of each thumb can be binded.
Here is a demo of how it look

from ui-slider.

Nate-Wilkins avatar Nate-Wilkins commented on September 15, 2024

@douglasduteil How far along was this? I see the build is currently failing on travis but not sure if that's a setup issue or not.

Will the no-jquery branch eventually be (or merged to) master?

from ui-slider.

douglasduteil avatar douglasduteil commented on September 15, 2024

Hi @Nate-Wilkins
I was near a official release but presently I don't have the time to do it... If I remember right the branch I was working on was the pure-angular on the 'scenar' tests

from ui-slider.

apitts avatar apitts commented on September 15, 2024

I have been using this branch (no-jqui-here) for a while now....really like the features and lack of jQuery.

from ui-slider.

johnparn avatar johnparn commented on September 15, 2024

Sounds promising. We should definitely make this the master if it is ready
for release. I haven't had the opportunity to use this branch myself so far.

//John
Den 19 apr 2014 07:18 skrev "Andrew Pitts" [email protected]:

I have been using this branch for a while now....really like the features
and lack of jQuery.


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-40861194
.

from ui-slider.

apitts avatar apitts commented on September 15, 2024

The only issue I have found so far is that it does not seem to handle decimals well. For example, a slider with a range of 0 to 5 (step of 0.02) and starting values of 0.3 and 1.0 doesn't seem to work well. It starts at 0 and 1.0. A chance this could be an error I'm making though.

from ui-slider.

apitts avatar apitts commented on September 15, 2024

@douglasduteil @johnparn any further thoughts about making the no-jqui-here branch master? Thanks.

By the way, I'm not certain, but I think the issue with decimal places is being caused by Math.floor.

from ui-slider.

Nate-Wilkins avatar Nate-Wilkins commented on September 15, 2024

@douglasduteil no problem I can look through the code test out any remaining bugs. I'll report back when/if I find any. Thanks!

from ui-slider.

apitts avatar apitts commented on September 15, 2024

Sharing the below in case it is helpful.

So, I think that the issue that I was having with the decimal places is now resolved. Once I added a step on each ui-slider-thumb that was the same as the step that I had on the ui-slider, I no longer had the issue. What I believe was happening is that the default values for the thumb (i.e. 1 was overriding the value I expected from the ui-slider).

I did however notice a couple of other things. I was getting this issue with values over 100 but only where I had two thumbs and a range (obviously the proposed solution doesn't really apply to this branch or at least I couldn't see how): #20. What I did to fix this (hopefully) is to change _cache.[x] to iAttrs.[x], e.g.:

            _cache.min = (angular.isDefined(iAttrs.min)) ? _cache.min : uiSliderCtrl.min;

to

            _cache.min = (angular.isDefined(iAttrs.min)) ? iAttrs.min : uiSliderCtrl.min;

This change is in a fork I created today...seems OK at the moment but I haven't thoroughly tested it: https://github.com/apitts/ui-slider

Another issue I had was in passing an expression for a step size. If the max value was not a multiple of the step size, the max value displayed would be slightly less than the inputted max value due to rounding I believe caused by these lines:

formattedValue = Math.floor(formattedValue / step) * step;
return Math.floor(value / _cache.step) * _cache.step;

Basically, I was choosing a step value that divided evenly into (max - min) which I think makes sense but these calculations seem to require that it divides evenly into max. For the moment I have fixed this by choosing a step value that divides evenly into max.

from ui-slider.

 avatar commented on September 15, 2024

@douglasduteil ... very nice slider ... small request (which you can ignore if you don't think it worth it).

The no-jqui slider is not compatible with Angular 1.1.x as it's using one 1.2.x feature which makes this not work on 1.1.x angular.

it's: $isEmpty

Could you consider null/empty check without use of $isEmpty?

https://github.com/angular/angular.js/blob/e37e67eadbd5c8b5342499f8a4f27d644106b3f2/src/ng/directive/select.js#L235

https://github.com/angular-ui/ui-slider/blob/no-jqui-here/src/ui-slider.js#L273
https://github.com/angular-ui/ui-slider/blob/no-jqui-here/src/ui-slider.js#L288
https://github.com/angular-ui/ui-slider/blob/no-jqui-here/src/ui-slider.js#L303
https://github.com/angular-ui/ui-slider/blob/no-jqui-here/src/ui-slider.js#L315

from ui-slider.

douglasduteil avatar douglasduteil commented on September 15, 2024

Hi all I made another poke for this. An 'official' update will be made soon enough.

from ui-slider.

rzschech avatar rzschech commented on September 15, 2024

@douglasduteil you should take a look at apitts improvements made here: https://github.com/apitts/ui-slider

from ui-slider.

douglasduteil avatar douglasduteil commented on September 15, 2024

@rzschech @apitts That looks cool.
I'm looking forward to merge some of those changed 👍

from ui-slider.

apitts avatar apitts commented on September 15, 2024

Excellent! 👍 Thanks @douglasduteil!

from ui-slider.

rzschech avatar rzschech commented on September 15, 2024

@douglasduteil I've added support for step="any" similar to:

<input type="number" step="any">

rzschech@8257e85

from ui-slider.

PowerKiKi avatar PowerKiKi commented on September 15, 2024

@douglasduteil where are we with the no-jquery version ? anything that should be merged here ? or did it become an independent project ? should this issue be closed ?

from ui-slider.

douglasduteil avatar douglasduteil commented on September 15, 2024

Hi. Good timing @PowerKiKi I'm actually working on a new version of it :)
my last attempt

from ui-slider.

PowerKiKi avatar PowerKiKi commented on September 15, 2024

let us know if/when something should be merged here

from ui-slider.

PowerKiKi avatar PowerKiKi commented on September 15, 2024

Closing as obsolete

from ui-slider.

Related Issues (20)

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.