mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Merge branch '0.4-maintenance'
Conflicts: core/server/config/paths.js core/test/unit/config_spec.js
This commit is contained in:
commit
e81893a7ef
4 changed files with 22 additions and 32 deletions
|
@ -49,9 +49,6 @@
|
|||
};
|
||||
|
||||
Ghost.init = function () {
|
||||
// remove the temporary message which appears
|
||||
$('.js-msg').remove();
|
||||
|
||||
Ghost.router = new Ghost.Router();
|
||||
|
||||
// This is needed so Backbone recognizes elements already rendered server side
|
||||
|
|
|
@ -4,37 +4,29 @@
|
|||
"use strict";
|
||||
NProgress.configure({ showSpinner: false });
|
||||
|
||||
Ghost.ProgressModel = Backbone.Model.extend({
|
||||
|
||||
// Adds in a call to start a loading bar
|
||||
// This is sets up a success function which completes the loading bar
|
||||
fetch : function (options) {
|
||||
options = options || {};
|
||||
|
||||
// Adds in a call to start a loading bar
|
||||
// This is sets up a success function which completes the loading bar
|
||||
function wrapSync(method, model, options) {
|
||||
if (options !== undefined && _.isObject(options)) {
|
||||
NProgress.start();
|
||||
|
||||
var self = this,
|
||||
oldSuccess = options.success;
|
||||
|
||||
options.success = function () {
|
||||
NProgress.done();
|
||||
return oldSuccess.apply(self, arguments);
|
||||
};
|
||||
|
||||
return Backbone.Model.prototype.fetch.call(this, options);
|
||||
}
|
||||
|
||||
return Backbone.sync.call(this, method, model, options);
|
||||
}
|
||||
|
||||
Ghost.ProgressModel = Backbone.Model.extend({
|
||||
sync: wrapSync
|
||||
});
|
||||
|
||||
Ghost.ProgressCollection = Backbone.Collection.extend({
|
||||
|
||||
// Adds in a call to start a loading bar
|
||||
// This is sets up a success function which completes the loading bar
|
||||
fetch : function (options) {
|
||||
options = options || {};
|
||||
|
||||
NProgress.start();
|
||||
|
||||
options.success = function () {
|
||||
NProgress.done();
|
||||
};
|
||||
|
||||
return Backbone.Collection.prototype.fetch.call(this, options);
|
||||
}
|
||||
sync: wrapSync
|
||||
});
|
||||
}());
|
|
@ -134,6 +134,12 @@
|
|||
var $target = $(e.currentTarget),
|
||||
searchTerm = $.trim($target.val());
|
||||
|
||||
if (searchTerm) {
|
||||
this.showSuggestions($target, searchTerm);
|
||||
} else {
|
||||
this.$suggestions.hide();
|
||||
}
|
||||
|
||||
if (e.keyCode === this.keys.UP) {
|
||||
e.preventDefault();
|
||||
if (this.$suggestions.is(":visible")) {
|
||||
|
@ -159,12 +165,6 @@
|
|||
if (e.keyCode === this.keys.UP || e.keyCode === this.keys.DOWN) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (searchTerm) {
|
||||
this.showSuggestions($target, searchTerm);
|
||||
} else {
|
||||
this.$suggestions.hide();
|
||||
}
|
||||
},
|
||||
|
||||
handleKeydown: function (e) {
|
||||
|
|
|
@ -212,6 +212,7 @@
|
|||
ne2Password = this.$('input[name="ne2password"]').val();
|
||||
|
||||
if (newPassword !== ne2Password) {
|
||||
Ghost.notifications.clearEverything();
|
||||
Ghost.notifications.addItem({
|
||||
type: 'error',
|
||||
message: "Your passwords do not match.",
|
||||
|
|
Loading…
Add table
Reference in a new issue