Use old name default text on rename.
This commit is contained in:
@@ -118,10 +118,8 @@ $(document).ready(function() {
|
|||||||
$('#minibutton-rename-page').click(function(e) {
|
$('#minibutton-rename-page').click(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var path = $(this).data('path');
|
var path = window.location.pathname;
|
||||||
if (path) {
|
var oldName = path.substring(path.lastIndexOf('/')+1);
|
||||||
path = path + '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
$.GollumDialog.init({
|
$.GollumDialog.init({
|
||||||
title: 'Rename Page',
|
title: 'Rename Page',
|
||||||
@@ -130,7 +128,7 @@ $(document).ready(function() {
|
|||||||
id: 'name',
|
id: 'name',
|
||||||
name: 'Rename to',
|
name: 'Rename to',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
defaultValue: path || ''
|
defaultValue: oldName || ''
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
OK: function( res ) {
|
OK: function( res ) {
|
||||||
@@ -138,8 +136,7 @@ $(document).ready(function() {
|
|||||||
if ( res['name'] ) {
|
if ( res['name'] ) {
|
||||||
name = res['name'];
|
name = res['name'];
|
||||||
}
|
}
|
||||||
var path = window.location.pathname;
|
|
||||||
var oldName = path.substring(path.lastIndexOf('/')+1);
|
|
||||||
var msg = 'Renamed ' + oldName + ' to ' + name;
|
var msg = 'Renamed ' + oldName + ' to ' + name;
|
||||||
jQuery.ajax( {
|
jQuery.ajax( {
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
|||||||
Reference in New Issue
Block a user