Comments (11)
I can look into it in the next days.
For the CSS we don't need a new class, this selector should work well.
For JS we could then check for presence of the href
attribute instead:
if (!link.hasAttribute('href') || link.getAttribute('href')[0] !== '#'))
return;
Do you have a suggestion for a better check than href[0] !== '#'
?
from leaflet-sidebar-v2.
I'm not sure about a better check for href[0], but updating
if (link.hasAttribute('href') && link.getAttribute('href')[0] !== '#')
to
if (!link.hasAttribute('href') || link.getAttribute('href')[0] !== '#'))
would probably be good regardless.
How would this feature impact sidebar.addPanel? One pro of using a class is that sidebar.addPanel would need less changes. You could add an optional property (i.e. anchorClass or tabClass) to set anchor's class when adding it via js, and both should work as expected.
from leaflet-sidebar-v2.
The proposed change would allow a sidebar button to act externally of the the sidebar. For example, clicking a gear button on the sidebar could open a modal window rather than a sidebar tab. Please let me know if I'm mistaken.
I'm cautiously supportive of the idea. Implementation needs careful consideration though.
I'm unable to see how the proposed link check would be better. Can someone provide an example? Here's a quick jsbin that compares the existing and proposed link checks with a few scenarios.
from leaflet-sidebar-v2.
@nickpeihl This feature exists already. What @ChaudhryAtif wants, is to support this in the html-markup version as well.
The change of the check allows to omit the href="javascript:void(0);"
attribute for button-tabs in the markup. (Here's the same test, reworded)
from leaflet-sidebar-v2.
@noerw That makes sense to me. Thanks so much for explaining! I'm definitely in favor of this improvement.
from leaflet-sidebar-v2.
fixed in 78e4787
from leaflet-sidebar-v2.
@noerw Does this account for href being added by addPanel?
from leaflet-sidebar-v2.
Why wouldn't it? I tested this, and everything kept working
from leaflet-sidebar-v2.
Alright. Thanks for adding the feature!
from leaflet-sidebar-v2.
@noerw 3.0.1 (instead of 3.0.2) is the latest for npm install: https://www.npmjs.com/package/leaflet-sidebar-v2
from leaflet-sidebar-v2.
sorry. just pushed 3.0.2
from leaflet-sidebar-v2.
Related Issues (20)
- vue js wrapper HOT 1
- is there a react component availabe? thanks advanced HOT 2
- Can't refresh content HOT 1
- Sidebar on right side causes attribution shift HOT 1
- Is there a way to use JS inside a pane HOT 1
- IE compatibility HOT 2
- fa-bars do not consider top margin. Is it possible to change in the css file? HOT 1
- Allow determining whether sidebar is currently open or closed.
- can you give this library for react version ? HOT 1
- How to use in React? HOT 1
- Allow deep links to tabs
- Place the .leaflet-sidebar-tabs at the bottom horizontally rather than vertically on the left or on the right
- I can't un-insert the checkboxes in the panel HOT 1
- How to update content dynamic
- addUser() function not working. HOT 1
- Icons go invisible after clicking between panels.
- Remove Github link
- react-leaflet-sidebar-v2 hook
- is it possible to remove the tabs pane when we have only one panel
- Open sidebar pane on tooltip click?
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 leaflet-sidebar-v2.