superdesk/superdesk-client-core

View on GitHub
scripts/core/ui/views/sd-multi-select.html

Summary

Maintainability
Test Coverage
<div class="dropdown dropdown--dropright dropdown-terms" dropdown sd-dropdown-focus sd-dropdown-position>

    <button class="dropdown__toggle" dropdown__toggle ng-disabled="disabled" ng-if="!disabled" aria-label="{{ 'Add new' | translate }}">
        <i class="icon--white icon-plus-large"></i>
    </button>

    <ul class="dropdown__menu nested-menu pull-right">
        <li>
            <div sd-typeahead items="listCopy" term="selectedTerm" search="searchTerms(term)" select="selectItem(item)" data-disabled="disabled">
                <ul class="item-list" vs-repeat vs-scroll-parent=".item-list" ng-if="activeList">
                    <li typeahead-item="t" ng-repeat="t in terms"><button>{{ :: t}}</button></li>
                </ul>
            </div>
        </li>

        <li class="main-list" ng-if="!activeList">
            <ul vs-repeat vs-scroll-parent=".main-list">
                <li ng-repeat="item in listCopy">
                    <button ng-click="selectItem(item)">{{ :: item}}</button>
                </li>
            </ul>
        </li>
    </ul>
</div>

<ul class="terms-list" ng-if="selectedItems.length">
    <li class="pull-left" ng-repeat="item in selectedItems" ng-click="removeItem(item)">
        {{ :: item}} <i role="button" aria-label="{{'Remove item'| translate }}" class="icon-close-small"></i>
    </li>
</ul>