Fix JSLint issues in Dialog; add revert dialog on history page
This commit is contained in:
@@ -29,7 +29,27 @@ $(document).ready(function() {
|
||||
|
||||
$('#wiki-history td.revert-action a').mouseenter(highlightOn);
|
||||
$('#wiki-history td.revert-action a').mouseleave(highlightOff);
|
||||
};
|
||||
}
|
||||
|
||||
if ($('td.revert-action a').length) {
|
||||
$('td.revert-action a').click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var commitSha = $(this).attr('rel');
|
||||
var truncatedSha = commitSha.toString().substr(0, 7) + "…";
|
||||
// revert action
|
||||
$.GollumDialog.init({
|
||||
title: 'Revert to ' + truncatedSha + '?',
|
||||
body: 'Are you sure you wish to revert to revision <code>' +
|
||||
truncatedSha + '</code>' +
|
||||
' ? This will overwrite any previous changes.',
|
||||
OK: function() {
|
||||
// TODO add async endpoint to revert here
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user