Opened 13 years ago

Closed 13 years ago

#819 closed defect (fixed)

Calling 'disable()' has no effect on InlineEditBox.

Reported by: Ashish Owned by: alex
Priority: high Milestone: 0.9
Component: Widgets Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

Calling 'disable()' has no effect on InlineEditBox?.It seems enable/disable functions have not been over-riden for this control.

Change History (4)

comment:1 Changed 13 years ago by dylan

Milestone: 0.5

comment:2 Changed 13 years ago by dylan

Owner: changed from Alex to alex

comment:3 Changed 13 years ago by gregory.murray@…

Here is the patch to allow for eanbling and disabling of the InlineEditBox? in both editing mode and non-editing mode:

Index: InlineEditBox?.js =================================================================== --- InlineEditBox?.js (revision 5408) +++ InlineEditBox?.js (working copy) @@ -34,6 +34,7 @@

textValue: "", defaultText: "", doFade: false,

+ disabled: false,

onSave: function(newValue, oldValue){}, onUndo: function(value){},

@@ -54,7 +55,7 @@

},

mouseover: function(e){

  • if(!this.editing){

+ if(!this.editing && !this.disabled){

dojo.html.addClass(this.editable, "editableRegion"); if(this.mode == "textarea"){

dojo.html.addClass(this.editable, "editableTextareaRegion");

@@ -72,7 +73,7 @@

When user clicks the text, then start editing. Hide the text and display the form instead. beginEdit: function(e){

  • if(this.editing){ return; }
+ if(this.editing
this.disabled){ return; }

this.mouseout(); this.editing = true;

@@ -119,6 +120,22 @@

this.finishEdit(e);

},

+ disable: function(e){ + this.submitButton.disabled = true; + this.cancelButton.disabled = true; + var ee = this[this.mode.toLowerCase()]; + ee.disabled = true; + this.disabled = true; + }, + + enable: function(e){ + this.checkForValueChange(); + this.cancelButton.disabled = false; + var ee = this[this.mode.toLowerCase()]; + ee.disabled = false; + this.disabled = false; + }, +

cancelEdit: function(e){

if(!this.editing){ return false; } this.editing = false;

comment:4 Changed 13 years ago by jkuhnert

Resolution: fixed
Status: newclosed

(In [5409]) Applying changes to give InlineEditBox? a working enable/disable implementation. Fixes #819

Note: See TracTickets for help on using tickets.