[MAGNOLIA-3771] Codemirror editor variable should be global so that it's accessible by any javascript Created: 29/Jul/11  Updated: 01/Aug/11  Resolved: 29/Jul/11

Status: Closed
Project: Magnolia
Component/s: gui
Affects Version/s: None
Fix Version/s: 4.4.5

Type: Task Priority: Major
Reporter: Federico Grilli Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MGNLGROOVY-35 Running a new, not yet saved script w... Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty

 Description   

At the moment, the codemirror editor js variable created by DialogEditCode is local to the anonymous js function that instantiates it (the var keyword is used). We need to make its scope global so that other scripts can access it. In particular, I am thinking about the groovy module and this long-standing bug MGNLGROOVY-35.
This should be safe in case there are multiple instances of the DialogEditCode control, since each editor variable should be created with a unique name.



 Comments   
Comment by Federico Grilli [ 29/Jul/11 ]

Only tested manually as writing a unit test for this is too complicated (lots of dependent code to mock and set up).

Generated at Mon Feb 12 03:49:31 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.