Comments (3)
Couldn't you do something like this? Or do they get replaced?
snapper.on('drag', myFunc);
snapper.on('drag', anotherFunc);
If the drag function does get replaced, I want to keep the weight of this library down as much as possible because it's goal is rather small, (open the menu. that's it, hehe), so I don't want to bloat the library.
What about doing something like this?
snapper.on('drag', function(){
myFunc.call();
anotherFunc.call();
});
Thoughts?
from snap.js.
i am listening on the animated event to hide/show left or right drawer
but in some scenario I also need to know when the event animated is fired to replace or destroy the content of the drawer. so I do something like that in my updated version
snapper.once('animated', function() {view.dispose();});
nice thing with component.js is that dependencies are shared, thus not impacting global file size
but I understand not everybody is using it ;-) and that you don't want to add dependencies to Snap.js
from snap.js.
I think I am going to leave it the way it is for now, it's current state should allow you to do what you need to. You'd just need to check in your code if your view actually needs to be disposed, and if it has been, you can do the following:
var view = {
dispose: function(e){
if(needsToDispose){
snapper.off('animated');
// Dispose shiet
}
}
};
snapper.on('animated', view.dispose);
from snap.js.
Related Issues (20)
- how to fixed this bug ?
- Is there a NPM module available for Snap.js ? HOT 4
- heading having issue being fixed positioning in ie10. HOT 1
- tapToClose does not prevent the menu from being close when set to 'false'
- Broken on Chrome's devtools mobile device emulator HOT 1
- How to work with bootstrap 3 ? HOT 1
- Keep content size while snapping
- How to have menu open on page load? HOT 1
- "dir = rtl " breaks the right drawer? HOT 1
- Snap is not closing in Windows 10, Browser ie11
- snapper.trigger('start');
- New Maintainers HOT 1
- Adding bootstrap dropdown box
- Jumpping bug in modal when button have position: relative
- Demo breaks if you move over the sidebar
- How do I prevent triggering menu open when scrolling on certain element. HOT 1
- Is this going to be updated? HOT 4
- Disable dragging effect on desktop HOT 1
- Make sticky?
- Is it a typo ? shelfs versus shelves
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snap.js.