123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- 'use strict';
- define(['../../lib/@waca/baglass/js/baglass/app/ContentView', 'jquery', 'underscore', 'bspopover',
- 'jquery-ui'], function (BaseClass, $, _) {
- var DashboardView = BaseClass.extend({
- init: function init(options) {
- DashboardView.inherited('init', this, arguments);
- this.options = options || {};
- },
- getCDNUrl: function getCDNUrl() {
-
- var dashboardCdn = require.toUrl('dashboard-cdn');
- var cdn = '';
- if (dashboardCdn.indexOf('empty:') === -1) {
- cdn = dashboardCdn;
- }
- return cdn + 'dashboard-core/';
- },
-
- render: function render() {
-
- return Promise.resolve();
- },
-
- remove: function remove() {
- this.boardModel && this.boardModel.off();
- DashboardView.inherited('remove', this, arguments);
- },
-
- getTitle: function getTitle() {
-
- },
-
- deactivate: function deactivate() {
-
- $('.popover').popover('hide');
-
-
- this.$children = this.$el.children();
- this.$children.detach();
-
- var content = this.getContent();
- if (content) {
- _.extend(this.options, content);
- }
- return Promise.resolve();
- },
-
- activate: function activate() {
- if (this.$children) {
- this.$el.append(this.$children);
-
- setTimeout(function () {
- try {
- $(window).resize();
- } catch (e) {
-
- }
- }, 100);
- this.$children = null;
- }
- return Promise.resolve();
- },
- clearTransientState: function clearTransientState() {
- this.transientState = {};
- },
-
- setTransientState: function setTransientState(name, value) {
- if (!this.transientState) {
- this.transientState = {};
- }
- this.transientState[name] = value;
- },
-
- getTransientState: function getTransientState(name) {
- var value = null;
- if (this.transientState) {
- value = this.transientState[name];
- }
- return value;
- }
- });
- return DashboardView;
- });
|