iominh / ng-scrollbars

Angular wrapper of Malihu's jQuery Custom Scrollbar
http://iominh.github.io/ng-scrollbars/
MIT License
202 stars 62 forks source link

THe buttons doesn't work #7

Closed brujo-rojas closed 9 years ago

brujo-rojas commented 9 years ago

Tested in chrome in linux and osx, and firefox in linux, in my app and in http://minhongrails.github.io/ng-scrollbars/

iominh commented 9 years ago

Thanks for the issue. Can you describe more what you mean by the buttons don't work? Do you have a screenshot and more details on what browser and OS versions you're running?

It works for me in the latest Chrome 42.0.2311.135 (64-bit) and Firefox 37.0.1 on OSX 10.10 (Yosemite). I also just tested it on Firefox 31.1.0 on Centos 7

iominh commented 9 years ago

Also does the original http://manos.malihu.gr/jquery-custom-content-scroller/ work for you?

brujo-rojas commented 9 years ago

the original work for me, but no the angular version,

osx: 10.10.2 chrome: Versión 42.0.2311.135 (64-bit) (with a lot of plugins) firefox: 37.0.1 (without plugins)

Ubuntu: 14.04(another notebook, ACER) chrome Versión 42.0.2311.135 (64-bit) firefox 37.0.2

brujo-rojas commented 9 years ago

I was testing with the demo page

iominh commented 9 years ago

That's odd that it fails for you on your OSX machine because you're nearly running the same browsers I am on the same OS, yet I don't have errors. Do you have any screenshots and dev console errors?

brujo-rojas commented 9 years ago

No errors captura de pantalla 2015-04-29 a las 14 44 31

iominh commented 9 years ago

Ah, interesting, I'm confused though, what appears to be the problem? It looks like it's working? The buttons for the minimal and minimal-dark are intentionally meant to be hidden. Each panel is a different theme?

brujo-rojas commented 9 years ago

I not modify anything, all looks good and the scroll works, but the buttons no working :/ I don't know why

iominh commented 9 years ago

Ohhh haha, you mean clicking on the actual buttons on the scrollbars. Actually I see that issue too, that's a bug. I don't know how I didn't catch that sooner. I'll try to fix this as soon as I can and will update this ticket once I do

Thanks so much for the help!

brujo-rojas commented 9 years ago

ok, excellent :D thanks you dooo much

iominh commented 9 years ago

Hey brujo696, the fix actually should hopefully be a simple 1 line change to your code. Can you try http://minhongrails.github.io/ng-scrollbars/? I tested that it works in the latest Chrome and Firefox.

The problem actually is because the configuration "scrollAmount: auto" wasn't being set on the Malihu scrollbars. For example, see the following, where I added scrollAmount to the ScrollBarsProvider code.

var app = angular.module('app', ['ngScrollbars']);
app.config(function (ScrollBarsProvider) {
    // the following settings are defined for all scrollbars unless the
    // scrollbar has local scope configuration
    ScrollBarsProvider.defaults = {
        scrollButtons: {
            scrollAmount: 'auto', // scroll amount when button pressed
            enable: true // enable scrolling buttons by default
        },
        scrollInertia: 400, // adjust however you want
        axis: 'yx' // enable 2 axis scrollbars by default,
        theme: 'dark',
        autoHideScrollbar: true
    };
});

You shouldn't need to update your ng-scrollbars version but I pushed version 0.0.5 with the updated default code and documentation.

Also if this works, could you please star this repo? That'll really help me, thanks!

brujo-rojas commented 9 years ago

thanks... work now Started repo :star2:

iominh commented 9 years ago

Sweet, thanks a lot! Appreciate it!

CreativeHouseDotOrg commented 6 years ago

Adding the scrollButtons prop to the config in the angular scope fixed the issue! The arrow buttons work now. Thanks!