[MGNLUI-4367] Crop tool has javascript errors Created: 14/Feb/18  Updated: 19/Feb/18

Status: Accepted
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.6.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Philipp Gaschuetz Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File jcrop_connector.js    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

The commit, which fixes MGNLUI-4310 introduced a new bug.

Instead of

 
this.isEnabled = function() { 
  return getState().enabled !== false 
}

it should read:

 
this.isEnabled = function() { 
  return **this**.getState().enabled !== false
}

Furthermore, I believe, there is one additional bug:
The commit changed line 51
from

 
        if (!jcrop || !state.isValid) {

to

 
        if (!jcrop || !this.isEnabled()) {

I believe this should be reverted.



 Comments   
Comment by Philipp Gaschuetz [ 17/Feb/18 ]

Please see the attached, corrected, working and slightly cleaned up version.

Generated at Mon Feb 12 09:15:56 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.