mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 03:22:21 +03:00
Merge pull request #1648 from KingKarl85/api-slashes
backbonejs model conflict with connect-slashes
This commit is contained in:
commit
09d8329712
@ -41,6 +41,13 @@
|
|||||||
return Backbone.oldsync(method, model, options, error);
|
return Backbone.oldsync(method, model, options, error);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Backbone.oldModelProtoUrl = Backbone.Model.prototype.url;
|
||||||
|
//overwrite original url method to add slash to end of the url if needed.
|
||||||
|
Backbone.Model.prototype.url = function () {
|
||||||
|
var url = Backbone.oldModelProtoUrl.apply(this, arguments);
|
||||||
|
return url + (url.charAt(url.length - 1) === '/' ? '' : '/');
|
||||||
|
};
|
||||||
|
|
||||||
Ghost.init = function () {
|
Ghost.init = function () {
|
||||||
// remove the temporary message which appears
|
// remove the temporary message which appears
|
||||||
$('.js-msg').remove();
|
$('.js-msg').remove();
|
||||||
|
Loading…
Reference in New Issue
Block a user