PHP Classes

File: vendors/select2/src/js/select2/compat/containerCss.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/select2/src/js/select2/compat/containerCss.js   Download  
File: vendors/select2/src/js/select2/compat/containerCss.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Gentelella BladeOne
Render templates using Bootstrap for presentation
Author: By
Last change:
Date: 3 years ago
Size: 1,455 bytes
 

Contents

Class file image Download
define([ 'jquery', './utils' ], function ($, CompatUtils) { // No-op CSS adapter that discards all classes by default function _containerAdapter (clazz) { return null; } function ContainerCSS () { } ContainerCSS.prototype.render = function (decorated) { var $container = decorated.call(this); var containerCssClass = this.options.get('containerCssClass') || ''; if ($.isFunction(containerCssClass)) { containerCssClass = containerCssClass(this.$element); } var containerCssAdapter = this.options.get('adaptContainerCssClass'); containerCssAdapter = containerCssAdapter || _containerAdapter; if (containerCssClass.indexOf(':all:') !== -1) { containerCssClass = containerCssClass.replace(':all:', ''); var _cssAdapter = containerCssAdapter; containerCssAdapter = function (clazz) { var adapted = _cssAdapter(clazz); if (adapted != null) { // Append the old one along with the adapted one return adapted + ' ' + clazz; } return clazz; }; } var containerCss = this.options.get('containerCss') || {}; if ($.isFunction(containerCss)) { containerCss = containerCss(this.$element); } CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter); $container.css(containerCss); $container.addClass(containerCssClass); return $container; }; return ContainerCSS; });