client/tags: mark used tags in autocomplete
This commit is contained in:
		
							parent
							
								
									81afd383fa
								
							
						
					
					
						commit
						dbf44ed58f
					
				@ -325,3 +325,5 @@ input[type=file]:focus+.file-dropper,
 | 
			
		||||
                color: $button-enabled-text-color
 | 
			
		||||
                span
 | 
			
		||||
                    color: $button-enabled-text-color
 | 
			
		||||
            .disabled
 | 
			
		||||
                color: $inactive-link-color
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,9 @@ class TagAutoCompleteControl extends AutoCompleteControl {
 | 
			
		||||
        const caseSensitive = false;
 | 
			
		||||
        const minLengthForPartialSearch = 3;
 | 
			
		||||
 | 
			
		||||
        options = Object.assign({}, options);
 | 
			
		||||
        options = Object.assign({
 | 
			
		||||
            isTaggedWith: tag => false,
 | 
			
		||||
        }, options);
 | 
			
		||||
 | 
			
		||||
        options.getMatches = text => {
 | 
			
		||||
            const transform = caseSensitive ?
 | 
			
		||||
@ -30,7 +32,10 @@ class TagAutoCompleteControl extends AutoCompleteControl {
 | 
			
		||||
                        tags.getOriginalTagName(kv[0]));
 | 
			
		||||
                    const category = kv[1].category;
 | 
			
		||||
                    const usages = kv[1].usages;
 | 
			
		||||
                    const cssName = misc.makeCssName(category, 'tag');
 | 
			
		||||
                    let cssName = misc.makeCssName(category, 'tag');
 | 
			
		||||
                    if (options.isTaggedWith(kv[0])) {
 | 
			
		||||
                        cssName += ' disabled';
 | 
			
		||||
                    }
 | 
			
		||||
                    return {
 | 
			
		||||
                        caption: misc.unindent`
 | 
			
		||||
                            <span class="${cssName}">
 | 
			
		||||
 | 
			
		||||
@ -56,6 +56,7 @@ class TagInputControl extends events.EventTarget {
 | 
			
		||||
                    this.addTag(text, SOURCE_USER_INPUT);
 | 
			
		||||
                },
 | 
			
		||||
                verticalShift: -2,
 | 
			
		||||
                isTaggedWith: tagName => this.isTaggedWith(tagName),
 | 
			
		||||
            });
 | 
			
		||||
        this._tagInputNode.addEventListener(
 | 
			
		||||
            'keydown', e => this._evtInputKeyDown(e));
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user