Opened 13 years ago

Closed 12 years ago

Last modified 9 years ago

#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 Jared Jurkiewicz)

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 Jared Jurkiewicz

Description: modified (diff)

comment:2 Changed 13 years ago by bill

Isn't this a dup of #9488?

But glad you traced down what the problem is.

comment:3 Changed 13 years ago by Jared Jurkiewicz

Might be a dup! I don't know, to be honest.

comment:4 Changed 13 years ago by Jared Jurkiewicz

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 Mike Wilcox

Milestone: tbdfuture

comment:6 Changed 12 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [21441]) Fixing a bunch of table plugin bugs, from buttons not activating/deactivating right, to errors in selection, to cleaning up the testcase. fixes #9856

comment:7 Changed 12 years ago by Jared Jurkiewicz

Milestone: future1.5

comment:8 Changed 9 years ago by bill

In [30506]:

Fix various problems on IE because the toolbar buttons become disabled when the editor's iframe is blurred.

In the same way that dijit/Editor saves and restores selection when the iframe is focused/blurred, we need to save/restore the info on the selected table cell.

Also, modifying the cell color picker code to use the standard way to close a TooltipDialog, via a <button type=submit>.

Refs #9856, fixes #16286 !strict.

comment:9 Changed 9 years ago by bill

In [30507]:

Rollback spurious spacing changes from my IDE, refs #9856, #16286 !strict.

Note: See TracTickets for help on using tickets.