@djs-button-pages/presets
Version:
A set of presets that are used for faster development.
38 lines (37 loc) • 940 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const djs_button_pages_1 = require("djs-button-pages");
/**
* Bind for button that stops pagination.
*/
class StopButton extends djs_button_pages_1.ButtonWrapper {
/**
* Bind for button that stop pagination.
* @param {ButtonData} style Styling for button.
*/
constructor(style) {
super(style);
this.setAction(StopButton._doAction);
this.setSwitch(StopButton._switch);
}
;
/**
* Action that stops pagination.
* @param {PaginationSent} pagination Pagination.
* @returns {Promise<void>}
*/
static _doAction(pagination) {
return pagination.stop();
}
;
/**
* Switch that never disables the button.
* @returns {false}
*/
static _switch() {
return false;
}
;
}
exports.default = StopButton;
;