/*! * UI development toolkit for HTML5 (OpenUI5) * (c) Copyright 2009-2018 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ sap.ui.define(['sap/m/library', 'sap/ui/Device'], function(library, Device) { "use strict"; // shortcut for sap.m.IconTabFilterDesign var IconTabFilterDesign = library.IconTabFilterDesign; /** * HBox renderer. * @namespace */ var IconTabHeaderRenderer = { }; /** * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}. * * @param {sap.ui.core.RenderManager} oRm the RenderManager that can be used for writing to the render output buffer * @param {sap.ui.core.Control} oControl an object representation of the control that should be rendered */ IconTabHeaderRenderer.render = function(oRM, oControl){ // return immediately if control is not visible if (!oControl.getVisible()) { return; } var aItems = oControl.getItems(), iItemsCount = aItems.length, aVisibleTabFilters = oControl.getVisibleTabFilters(), iVisibleTabFiltersCount = aVisibleTabFilters.length, iVisibleTabFilterIndex = 0, bTextOnly = oControl._checkTextOnly(aItems), bNoText = oControl._checkNoText(aItems), bInLine = oControl._checkInLine(aItems) || oControl.isInlineMode(), bShowOverflowSelectList = oControl.getShowOverflowSelectList(), oItem, bIsHorizontalDesign, bHasHorizontalDesign; var oIconTabBar = oControl.getParent(); var bUpperCase = oIconTabBar && oIconTabBar instanceof sap.m.IconTabBar && oIconTabBar.getUpperCase(); // render wrapper div oRM.write("
"); // render left scroll arrow oRM.renderControl(oControl._getScrollingArrow("left")); var sAriaHidden = Device.browser.msie ? "aria-hidden='true'" : ""; // render scroll container on touch devices oRM.write("
"); oRM.write("
"); for (var i = 0; i < iItemsCount; i++) { oItem = aItems[i]; oItem.render(oRM, iVisibleTabFilterIndex, iVisibleTabFiltersCount); if (oItem instanceof sap.m.IconTabFilter) { bIsHorizontalDesign = oItem.getDesign() === IconTabFilterDesign.Horizontal; if (bIsHorizontalDesign) { bHasHorizontalDesign = true; } if (oItem.getVisible()) { iVisibleTabFilterIndex++; } } } oRM.write("
"); oRM.write("
"); //scrollContainer // render right scroll arrow oRM.renderControl(oControl._getScrollingArrow("right")); // render overflow button if (bShowOverflowSelectList) { var oOverflowButton = oControl._getOverflowButton(); if (bInLine) { oOverflowButton.addStyleClass('sapMBtnInline'); } else if (bTextOnly) { oOverflowButton.addStyleClass('sapMBtnTextOnly'); } else if (bNoText || bHasHorizontalDesign) { oOverflowButton.addStyleClass('sapMBtnNoText'); } oRM.renderControl(oOverflowButton); } // end wrapper div oRM.write("
"); }; return IconTabHeaderRenderer; }, /* bExport= */ true);