Opened 12 years ago
Closed 11 years ago
#7828 closed defect (fixed)
dijit._editor._Plugin: custom plugins UI does not show up if they are meant to handle custom commands
Reported by: | lipik | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | Dijit | Version: | 1.2.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I am creating a pluging to handle the save command - a button is displayed that would carry out some custom action (save editor content upon being clicked). However, the UI comes in hidden due to the following code in _Plugin.js:
if (!this.editor.queryCommandAvailable(this.command)) { // console.debug("hiding:", this.command); if(this.button){ this.button.domNode.style.display = "none"; } }
It should be changed to:
if (this.useDefaultCommand && !this.editor.queryCommandAvailable(this.command)) { // console.debug("hiding:", this.command); if(this.button){ this.button.domNode.style.display = "none"; } }
Change History (5)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Milestone: | tbd → 1.5 |
---|
comment:3 Changed 12 years ago by
useDefaultCommand determines whether the function is provided by the native browser or not
so I think the suggested change should be made
comment:4 Changed 11 years ago by
Owner: | set to bill |
---|---|
Status: | new → assigned |
The current code and the 1.2 code actually checks for this.command.length to see if a command is defined, so I'm not sure where you copied that code from in the description above.
Still, the this.command.length check isn't sufficient because a plugin like TabIndent defines command but doesn't use the browser's native support to execute it. So I'll make the change.
comment:5 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I'm not sure what useDefaultCommand is for? There aren't any comments in the code. Can you explain what that parameter is for?