Comments (4)
After a closer reading of the doc, looks like we're supposed to use the 'hasFormat' or 'getPath' stuff..
So my suggestion is to provide an example of this, or something specifically directed at this issue in the doc (so its easier /faster to find)
from squire.
I did this in an angular wrapper here: http://hourlynerd.github.io/angular-squire/dist/
the code for it is here:
https://github.com/HourlyNerd/angular-squire/blob/master/app/modules/angular-squire/angular-squire.coffee#L156
it works by updating the menubar's class to contain the current selection's path, from there i can set the button styles to be active via css.
from squire.
interesting idea! I got it working earlier after scouring for the right function...
from squire.
I agree this should be added to the docs (pull request anyone? :D). As a reference, you might also find useful the source code for the integration we use at FastMail: https://github.com/fastmail/overture/blob/master/source/Overture/views/controls/RichTextView.js
from squire.
Related Issues (20)
- execCommand not needed in Firefox. HOT 1
- copy event handler produces more newlines than the user typed for "text/plain" HOT 2
- Invalid `setKeyHandler` `key` parameter type HOT 2
- Undo/ Redo does not reset the cursor position HOT 6
- Moving the editor causes a partial breakage of functionality HOT 3
- User controlled markup vs programatically generated markup HOT 1
- Regarding inline text formatting
- The purpose of the `while` loop in the `fixCursor` function is unclear
- Lists are not created automatically on Chrome Android
- Cursor position bug after link('a' element) paste in Firefox
- Missing DOMPurify import HOT 1
- willPaste event cannot be prevented HOT 2
- Region-specific key handlers HOT 2
- Redo shortcut ("Ctrl-Shift-Z") does not work
- Can not make list for Chinese characters entered via input method on safari HOT 1
- The caret displays in a wrong position on safari HOT 1
- Wrong format after pasted some plain text at the end of formatted text
- getFontInfo returns undefined for fontFamily and fontSize when they are both set on the same selection
- Html gets reformatted on Undo
- Property 'append' does not exist on type 'Node'. 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 squire.