mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUG Restrict URLSegment preview to editable fields
This fixes a bug where the Translatable module would have a duplicate preview because it had another ".urlsegment" field showing the value in its original language. See https://github.com/silverstripe/silverstripe-translatable/issues/43
This commit is contained in:
parent
f5007a5536
commit
2923e55c71
@ -11,9 +11,13 @@
|
||||
* Constructor: onmatch
|
||||
*/
|
||||
onmatch : function() {
|
||||
this._addActions(); // add elements and actions for editing
|
||||
this.edit(); // toggle
|
||||
this._autoInputWidth(); // set width of input field
|
||||
// Only initialize the field if it contains an editable field.
|
||||
// This ensures we don't get bogus previews on readonly fields.
|
||||
if(this.find(':text').length) {
|
||||
this._addActions(); // add elements and actions for editing
|
||||
this.edit(); // toggle
|
||||
this._autoInputWidth(); // set width of input field
|
||||
}
|
||||
|
||||
this._super();
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user