mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX: Updating URLSegment from Title field when new page is created
This commit is contained in:
parent
1863bb00db
commit
2945f9d963
@ -34,7 +34,7 @@
|
|||||||
self.updatePageTitleHeading();
|
self.updatePageTitleHeading();
|
||||||
self.parents('form').find('input[name=MetaTitle], input[name=MenuTitle]').val(self.val());
|
self.parents('form').find('input[name=MetaTitle], input[name=MenuTitle]').val(self.val());
|
||||||
// update the URLSegment
|
// update the URLSegment
|
||||||
URLSegment.closest('.urlsegment').update(self);
|
URLSegment.closest('.field.urlsegment').update(self);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -26,9 +26,9 @@
|
|||||||
* Return URLSegemnt val()
|
* Return URLSegemnt val()
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* (Bool) external (optional)
|
* (DOMElement) other (optional)
|
||||||
*/
|
*/
|
||||||
edit: function(external) {
|
edit: function(other) {
|
||||||
|
|
||||||
var field = this.find(':text'),
|
var field = this.find(':text'),
|
||||||
holder = this.find('.preview'),
|
holder = this.find('.preview'),
|
||||||
@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
// field updated from another fields value
|
// field updated from another fields value
|
||||||
// reset to original state
|
// reset to original state
|
||||||
if (external) this.edit();
|
if (other) this.edit();
|
||||||
|
|
||||||
return field.val();
|
return field.val();
|
||||||
},
|
},
|
||||||
@ -78,11 +78,10 @@
|
|||||||
holder = this.find('.preview'),
|
holder = this.find('.preview'),
|
||||||
currentVal = holder.text(),
|
currentVal = holder.text(),
|
||||||
updateVal,
|
updateVal,
|
||||||
external = null;
|
other = arguments[0];
|
||||||
|
|
||||||
if (field && field.val() !== "") {
|
if (other && other.val() !== "") {
|
||||||
updateVal = field.val();
|
updateVal = other.val();
|
||||||
external = true;
|
|
||||||
} else {
|
} else {
|
||||||
updateVal = field.val();
|
updateVal = field.val();
|
||||||
}
|
}
|
||||||
@ -91,7 +90,7 @@
|
|||||||
self.suggest(updateVal, function(data) {
|
self.suggest(updateVal, function(data) {
|
||||||
var newVal = decodeURIComponent(data.value);
|
var newVal = decodeURIComponent(data.value);
|
||||||
field.val(newVal);
|
field.val(newVal);
|
||||||
self.edit(external);
|
self.edit(other);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
self.edit();
|
self.edit();
|
||||||
@ -201,7 +200,7 @@
|
|||||||
*/
|
*/
|
||||||
_autoInputWidth: function() {
|
_autoInputWidth: function() {
|
||||||
var field = this.find(':text');
|
var field = this.find(':text');
|
||||||
field.width((field.width() + 9) - this.find('.prefix').width());
|
field.width((field.width() + 15) - this.find('.prefix').width());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user