szurubooru/client/js/controllers/page_controller.js

34 lines
699 B
JavaScript
Raw Normal View History

"use strict";
2016-04-10 22:13:01 +02:00
const settings = require("../models/settings.js");
const EndlessPageView = require("../views/endless_page_view.js");
const ManualPageView = require("../views/manual_page_view.js");
2016-04-10 22:13:01 +02:00
class PageController {
constructor(ctx) {
if (settings.get().endlessScroll) {
this._view = new EndlessPageView();
} else {
this._view = new ManualPageView();
}
}
get view() {
return this._view;
}
run(ctx) {
this._view.run(ctx);
2016-04-10 22:13:01 +02:00
}
showSuccess(message) {
this._view.showSuccess(message);
}
2016-06-11 09:59:29 +02:00
showError(message) {
this._view.showError(message);
2016-04-10 22:13:01 +02:00
}
}
module.exports = PageController;