#9856 closed defect (fixed)
A couple TablePlugin errors
Reported by: | Jared Jurkiewicz | Owned by: | Mike Wilcox |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | Editor | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
Reported from my co-worker:
The table plugin of the digit.Editor has a number of plugins that display toolbar button. The plugins are aimed at modifying existing table, as a result those buttons should be disabled when no table has been inserted into the editor or no table is in focus.
This does not happen and if you click on say modifyTable button when no table is in focus you get a javascript error.
The problem has been traced to TablePlugin?.js where in checkAvailable method a call is made to determine whether we have a table in focus:
this.currentlyAvailable = this.editor.hasAncestorElement("table");
The problem is hasAncestorElement has two return statements with the first one being : return hasAncestorElement: function(tagName){
return true return dojo.withGlobal(this.window, "hasAncestorElement",dijit._editor.selection, [tagName]);
}
Removing the return true will resolve the problem.
The only other case where the same issue can be seen is if you click on a table so buttons are enabled and you then click somewhere else outside the editor. The buttons remain active and click will result in a javascript error. Probably onblur should handled to resolve this but I have not looked into this.
Change History (9)
comment:1 Changed 13 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 13 years ago by
comment:4 Changed 13 years ago by
Further comments from co-worker:
There cases where even disabling of the button does not mean you can not click, (You can still click a disabled toolbar button !!!!???).
in TablePlugin?.js line 586:
launchModifyDialog: function() {
Added>>> if (!tablePluginHandler.checkAvailable()) {return;}
Adding this guard line will stop opening of the dialog when no table is in focus.
Clicking on a table and click outside of the Editor is still an issue.
comment:5 Changed 13 years ago by
Milestone: | tbd → future |
---|
comment:6 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 Changed 12 years ago by
Milestone: | future → 1.5 |
---|
Isn't this a dup of #9488?
But glad you traced down what the problem is.