123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- /*
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: SHARE
- *
- * (C) Copyright IBM Corp. 2015, 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
- * IBM Corp.
- */
- define([
- 'jquery',
- 'q',
- 'bi/sharecommon/utils/simpledoT',
- 'bi/sharecommon/utils/translator',
- 'bi/glass/app/ContentView',
- 'bi/commons/utils/Utils',
- 'bi/commons/ui/properties/PropertyUIControl',
- 'bootstrap'
- ], function($, Q, dot, t, View, Utils, PropertyUIControl) {
- 'use strict';
- var optionsSlideoutView = View.extend({
- /**
- * @constructs
- * @public
- * @param {Object} options - set of initial properties
- * @param {Object} options.$el - The HTML element this view will be created at
- * @param {Object} options.slideout - Glass slideout object.
- * @param {function} options.closeCallback - If defined this is called when remove() is executed.
- */
- init: function(options) {
- optionsSlideoutView.inherited('init', this, arguments);
- $.extend(this, options);
- },
- render: function() {
- var deferred = Q.defer();
- this._propertyUIControl = new PropertyUIControl({
- 'glassContext': this.glassContext,
- 'el': this.$el,
- 'closeCallback': this._close.bind(this),
- 'items': [{
- 'type': 'Banner',
- 'centerLabel': true,
- 'backButton': this.slideout.overlay,
- 'value': this.title
- }]
- });
- this._propertyUIControl.render().done(function() {
- this.$el.find('.propertiesUIControlPageView').append(this.content);
- this.$el.find('.propertyUIControl').addClass('new_schedule_panel');
-
- if(typeof this.setUpCallback === 'function') {
- this.setUpCallback(this.content);
- }
- this._setEvents();
- deferred.resolve(true);
- }.bind(this));
-
- return deferred.promise;
- },
- setFocus: function() {
- if(!this.slideout.overlay){
- this.$el.find(".checkbox:eq(0)").focus();
- }
- else {
- this.$el.find('*[tabindex]:eq(0)').focus();
- }
- },
- remove: function() {
- if(typeof this.closeCallback === 'function') {
- this.closeCallback();
- }
- },
- _setEvents: function() {
- this.$el.find('.schedule_primary_button').on('clicktap', function(){
- this._close();
- }.bind(this));
- },
- _close: function() {
- this.slideout.hide({
- hideOnly: true
- });
- }
- });
- return optionsSlideoutView;
- });
|