Initial commit

This commit is contained in:
zhongjin
2020-06-15 10:58:47 +08:00
commit 4f1dfe7564
8590 changed files with 1516878 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
var CoreView = require('backbone/core-view');
var template = require('./apply-button.tpl');
var checkAndBuildOpts = require('builder/helpers/required-opts');
var REQUIRED_OPTS = [
'onApplyClick',
'overlayModel'
];
module.exports = CoreView.extend({
events: {
'click .js-apply': '_onClick'
},
initialize: function (opts) {
checkAndBuildOpts(opts, REQUIRED_OPTS, this);
this._initBinds();
},
render: function () {
this.$el.html(template({
disabled: this._isDisabled()
}));
return this;
},
_initBinds: function () {
this.listenTo(this._overlayModel, 'change:visible', this.render);
},
_isDisabled: function () {
return this._overlayModel.get('visible');
},
_onClick: function () {
if (this._isDisabled()) return;
this._onApplyClick();
}
});

View File

@@ -0,0 +1,3 @@
<button class="u-lSpace--xl CDB-Button CDB-Button--primary <%- disabled ? 'is-disabled' : '' %> js-apply">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-small"><%- _t("editor.infowindow.apply") %></span>
</button>