Comments (3)
Thanks @rpeaugh! This can also be solved without changing the library JS by using some additional CSS:
.chrome-tab-close {
display: none !important
}
One advantage of this approach is it might allow you to easily toggle the closeability of a tab. This could be useful for #64 for example.
from chrome-tabs.
Hey Adam,
Thanks for the response. The CSS could be useful as you described.
I was thinking about the pinned tabs issue when I made that simple code change. With the code change, one can leave off the draggable and close options and the tab is "essentially" pinned. The one remaining issue is that, although it cannot be dragged, a draggable tab can be dragged over it, forcing it to move. This is a minor issue, but if draggabilly were updated to not be draggable over icons that are not draggable, then the first tab would remain pinned in that location. I would think that most developers, such as myself, are wanting to pin a Home/Welcome tab as the first tab. And as long as all pinned tabs were adjacent, and starting from the first tab, then they would all remain in those positions. On a side note, the code change eliminates the error that occurs when you leave off the chrome-tab-close class. Which, in my opinion, makes the code more friendly.
Now, if one were trying to create some tabs such as:
[pinned] [draggable] [draggable] [pinned] [draggable] [draggable]
That would definitely be an issue. Keeping that fourth tab in the fourth position, I cannot fathom a reason someone would want to do this. Though I suppose you would have to make the draggable tabs only draggable between the pinned tabs. Otherwise, the pinned tab would shift when a draggable tab was moved across it and it would no longer be in the fourth position.
from chrome-tabs.
Thanks @rpeaugh for this thoughtful context.
I could imagine an app that doesn’t need the concept of pinning tabs, but still wants to hide the close button on all or some tabs. Someone might simply want to hide the close buttons for aesthetic reasons while still supporting tab closing via a keyboard shortcut, for example.
So we’ll want to support the Google Chrome notion of pinned tabs (#64) while also keeping the library flexible to support the arbitrary hiding of a close button as needed by an app developer. This shouldn’t be too complicated to achieve but it may require a destructive version bump and/or motivate the need for more substantial documentation. All of which is possible, but just work I can’t commit to at the moment. Always open to a PR ;)
from chrome-tabs.
Related Issues (20)
- Add option to make tabs look like the new chrome
- chrome-tabs background color bleeding through individual tabs HOT 10
- Sticky :hover effects on mobile
- Link does not work HOT 1
- How to add iframe content into tab dynamically HOT 5
- Issues with AMD HOT 2
- Add the content window to each tab like chrome browser HOT 1
- Does not work in IE HOT 2
- Positioning content before first tab and at end of tabs (e.g window handling buttons) HOT 2
- Detect Reordering HOT 1
- Chrome Tabs Stacked VERTICALLY? HOT 1
- Chrome tab
- setAttribute value not triggering HOT 1
- Add tabs from right to left HOT 3
- React-compatible version HOT 3
- How to make the tabs undraggable? HOT 2
- Support "pinned" tabs
- Prevent closing some tabs (based on a condtion) HOT 1
- Electron Compatibility
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 chrome-tabs.