Comments (4)
Yes, what you are saying is valid. We might as well have the core do the searching and delegate to each plugin to allow it to them setup.
I created a new branch and commit making that change. I don't see a problem with that, but if you do please let me know.
from bulmajs.
I have read through the code base. Seem like a nice implementation :)
I am confused about the file naming. which file should developer include to get the functionality of notification ?
is it bulma.js ? or notification.js ?
And if you develop dropdown plugin? How would people be able to use both with minimal setup ?
from bulmajs.
I looked at html docs now @ https://vizuaalog.github.io/BulmaJS/
I would prefer the api to be more simple
// Import BulmaJS core and plugins
import Bulma from 'path/to/bulmajs/src/core';
import Notification from 'path/to/bulmajs/src/plugins/Notification';
// Register plugins with the core
Bulma.registerPlugin('notification', Notification);
// If you want to use the DOM API, execute the following function
// when the DOM has loaded
Bulma.traverseDOM();
// If you would like global access to Bulma
window.Bulma = Bulma; // This can be anything you wan
My preference would be, I am not 100 % sure how to do this.
But calling classes plugin seems limiting to me. Naming something plugins give it a
bit of limitation IMO.
// Import BulmaJS core and plugins
import Bulma from 'path/to/bulmajs/src/core';
import Notification from 'path/to/bulmajs/src/plugins/Notification';
let notification_elements = $('.notification') || document.getElementByClassname('.notifications')
Notification.track(notification_elements); // can pass in options
Dropdown.track(dropdown_elements, options);
Bulma.connect(Notification, Dropdown); //variable args list
// If you would like global access to Bulma
window.Bulma = Bulma; // This can be anything you wan
from bulmajs.
I don't see a problem at the moment with the current way things work.
I think for simplicity and being able to just 'drop' the JS to quickly prototyping, manually setting up every plugin to look through the HTML is a little bit overkill. I prefer the current way where the data-
tags are used. If someone doesn't like this method, then they can not use the data-
API and instead create the instances themselves through the regular JS API.
from bulmajs.
Related Issues (20)
- Additional API methods for Alert
- Additional API methods for Dropdown
- Additional API methods for the file component
- Additional API methods for the message component
- Additional API methods for the Modal component
- Additional API methods for navbar
- Additional API methods for notification
- Additional API methods for the tabs component
- Panel tabs are nor filtered by default (display all on load until manually filtered) HOT 4
- Webpack - Module parse failed: Unexpected token HOT 4
- Multiple Dropdowns HOT 4
- Support tree table HOT 1
- Cannot use import statement outside a module HOT 2
- Window is not defined when using nextjs HOT 5
- Navbar plugin does not work on dynamically inserted content HOT 3
- Trying to use it in electron, imports problems HOT 2
- Uncaught TypeError: this.triggerElement is null HOT 3
- Project alive? HOT 2
- CDN to allow more accessibility regarding installation HOT 1
- Creating modal: A plugin requires a root and/or a parent. HOT 1
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 bulmajs.