/* * popselect - v0.1.14 * Replaces traditional ' + '' + '
' + '{text}' + '
' + '', { tags: createTagsLi(options), text: text, placeholderText: classNames.placeholderText, tagWrapper: classNames.tagWrapper, selectTextarea: classNames.selectTextarea, selectTags: classNames.selectTags }); } function createTagStr(val, text) { return template('
  • ' + '×{text}' + '
  • ', { text: text, val: val, tag: classNames.tag, popoverClose: classNames.popoverClose }); } function createLiTag(val, text) { return template('
  • {text}
  • ', { val: val, text: text }); } function createPlaceholderInput() { return template('
  • ' + '
    ' + '' + '
    ' + '
  • ', { placeholder: classNames.placeholder }); } function createPopoverStr(list, settings) { return template('
    ' + (settings.showTitle ? '

    {title}

    ' : '') + '
    ' + '' + '
    ' + '
    ' + '
    ', { title: settings.title, list: list, arrow: classNames.arrow, popoverSelect: classNames.popoverSelect, popoverBody: classNames.popoverBody, selectList: classNames.selectList, top: settings.position, selectTitle: classNames.selectTitle }); } // A really lightweight plugin wrapper around the constructor, // preventing against multiple instantiations $.fn.popSelect = function(options) { if (typeof(options) === 'string') { if (options === 'value') { return this.next(addDot(classNames.tagWrapper)) .find(addDot(classNames.tag)).map(function(i, $elem) { return $($elem).attr(constants.attrVal); }); } else { console.warn(logs.unSupported); } } else { return this.each(function() { if (!$.data(this, 'plugin_' + pluginName)) { $.data(this, 'plugin_' + pluginName, new Plugin(this, options)); } }); } }; })(jQuery, window, document);