"use strict"; /** * Licensed Materials - Property of IBM * IBM Cognos Products: admin * Copyright IBM Corp. 2015, 2018 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['underscore', 'q', 'doT', 'bi/commons/utils/BidiUtil', 'bi/commons/utils/Utils', 'bi/commons/ui/AccessibleView', 'bi/admin/common/ui/ToggleMenuBar', 'text!bi/admin/common/templates/BasePane.html', 'bi/admin/nls/StringResource'], function (_, Q, dot, BidiUtil, Utils, AccessibleView, ToggleMenuBar, htmlPane, StringResource) { //NOSONAR: needed for amd /** * Sample content view that extends the glass View class * */ var BasePane = AccessibleView.extend({ title: '', showHeader: true, showGobackButton: false, showSwitchViewButton: false, autoValidate: false, flexBody: true, isWideView: false, init: function init(options) { BasePane.inherited('init', this, arguments); $.extend(this, options); var basePaneInfo = {}; basePaneInfo.strings = { 'goback': StringResource.get('goback'), 'switchViews': StringResource.get('switchViews') }; var sHtml = dot.template(htmlPane)(basePaneInfo); this.$el.append(sHtml); this.$el.addClass('bi-admin-vflex bi-admin-fullheight'); }, _setTextDirection: function _setTextDirection(elems) { for (var i = 0; i < elems.length; i++) { BidiUtil.initElementForBidi(elems[i]); } }, _autoValidate: function _autoValidate() { var self = this; if (!this.autoValidate) { return; } this.$el.find("[required]").on({ blur: this._onBlur.bind(self), invalid: this._onInvalid, focus: this._onFocus }); }, _onBlur: function _onBlur(e) { if (this._checkSpace(e.target)) { this._checkScript(e.target); } }, _onInvalid: function _onInvalid(e) { if (e.target.validity.valueMissing) { $(e.target.parentNode).append($("

").append($("