'use strict'; /* *+------------------------------------------------------------------------+ *| Licensed Materials - Property of IBM *| IBM Cognos Products: BI Dashboard *| (C) Copyright IBM Corp. 2017, 2018 *| *| US Government Users Restricted Rights - Use, duplication or disclosure *| restricted by GSA ADP Schedule Contract with IBM Corp. *+------------------------------------------------------------------------+ */ /** * Light Flyout view for showing information for the current widget. * This class can used to show different level messages when required. */ define(['jquery', '../../../lib/@waca/dashboard-common/dist/utils/FlyoutContentBase', 'doT', 'text!./templates/InfoList.html'], function ($, FlyoutContentBase, dot, template) { 'use strict'; var infoTemplate = dot.template(template); var InfoFlyoutView = FlyoutContentBase.extend([], { init: function init(options) { InfoFlyoutView.inherited('init', this, arguments); this.setMessages(options.viewOptions.messages); }, /** * @function setMessages * Set the information messages to the views * @param {Object[]} messages - array of info messages */ setMessages: function setMessages(messages) { this.messages = messages; }, setFocus: function setFocus() { $('.infoDiv').next().first('li').focus(); }, //@override onPopupShown: function onPopupShown() { this.onPopupClosed(); var _fnDisableParentScroll = function _fnDisableParentScroll(evt) { var orgEvent = evt.originalEvent; var delta = orgEvent.wheelDelta || -orgEvent.detail; this.scrollTop += (delta < 0 ? 1 : -1) * 10; evt.preventDefault(); }; $('.infoDataScrollable').on('mousewheel DOMMouseScroll', _fnDisableParentScroll); }, getRenderedHtml: function getRenderedHtml() { return infoTemplate({ 'messages': this.messages, 'small': this.messages.length > 1 }); } }); return InfoFlyoutView; }); //# sourceMappingURL=InfoFlyoutView.js.map