mtr / angular-iscroll

AngularJS module that enables iScroll 5 functionality, wrapping it in an easy-to-use directive.
MIT License
74 stars 27 forks source link

Automatically detect the need for using iScroll. #25

Closed mtr closed 8 years ago

mtr commented 8 years ago

Please see my question on StackOverflow about this.

Since no better solutions were suggested, I've decided to implement this by using platform.js.

simison commented 8 years ago

Is there a way to leave platform.js out if I'm setting this "always on" anyway?

Tried:

iScrollServiceProvider.configureDefaults({
  directive: {
    initiallyEnabled: true
  }
});

...but no dice.

mtr commented 8 years ago

Not yet, @simison. I've thought about implementing “nonsupport” for this kind of auto-detection, but haven't prioritized it yet. However, now that you ask for it, that at least counts as a +1 for that feature.

simison commented 8 years ago

Thanks!

BTW I feel like documentation regarding platform.js requirement should be improved. Now it can be a bit unclear.

mtr commented 8 years ago

@simison: I made some updates yesterday (haven't made the appropriate document updates yet). Among the changes, I added a small check (https://github.com/mtr/angular-iscroll/blob/master/src/lib/angular-iscroll.js#L35), so that if platform is not defined then useNativeScroll should become false. Can you verify that this helps in your case?

simison commented 8 years ago

@mtr yep, that works! Thanks!

BTW you forgot to update /dist/ files to 3.2.0

mtr commented 8 years ago

Great!

About the /dist/ files: looking at them (https://github.com/mtr/angular-iscroll/blob/master/dist/lib/angular-iscroll.js) I don't understand what you mean by them not being at version 3.2.0? The header comment says so, and the contents seem up to date? Are you looking at the GitHub repo or a local, outdated clone?

simison commented 8 years ago

Looking at tagged version: https://github.com/mtr/angular-iscroll/blob/b643c6ad36489d0aa614b08ed28c071c00e8411a/dist/lib/angular-iscroll.js

  1. Click hash from https://github.com/mtr/angular-iscroll/releases
  2. Click Browse Files
  3. Check dist folder

You simply tagged the version before generating dist files.

mtr commented 8 years ago

Ah! Thanks. My bad. Do you know a simple way to fix it using git, or should I just create a new patch release (3.2.1)?