Hello,
another problem here :-(.
I'm in love with the "sb-player-*-button" solution, because it implements stack of buttons and uses observers to manage them. I love this solution because in the css i set the image property for "on and off" button so I don't need to change this property via Dom when the button changes its state.
I tried to implement this solution creating a brand new button to manage a filter/nofilter button I've created, but "sb-player-*-button" use the "dataremote" observer type and i coldn't use it because (obviously) there's no dataremote to bind when mediaPage changes.
I decided to use a classical broadcaster/observer solution but i needed to write my own observer to implement the "inverted" attribute like in the dataremote type.
In the logic I hide one of the buttons so the other is shown, it works when Songbird runs the first time but when i register the observer to the broadcaster:
this._broadcaster = document.getElementById(this.getAttribute("broadcaster_id"))
this_broadcaster.addEventListener("DomAttrModified",onChange,false)
when the event is fired i lose the control over the object and all previuos reference, so i couldn't access the broadcaster or the parentNode of the observer anymore, and i couldn't switch the hidden attribute of buttons, so nothing works.
The implementation is very similar to the one provided by the implementation of sb-player-shuffle-button and observes type="dataremote", so I don't think it's necessary to paste my source code.
Thank you
Filed Under: Add-ons Development
previous forum topic | next forum topic »







