-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-using readonly attribute of md-chips directive.
I tried to use them before but they caused some problems as mentioned in this issue: angular/material#2841 However, it got fixed in v0.11 as mentioned in this comment: angular/material#2841 (comment)
- Loading branch information
Showing
7 changed files
with
160 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 22 additions & 24 deletions
46
HadithHouseWebsite/hadiths/static/hadiths/html/personselector.directive.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,27 @@ | ||
<span> | ||
<md-chips ng-hide="!ctrl.readOnly" md-autocomplete-snap md-require-match> | ||
<md-chip ng-if="ctrl.person"> | ||
{{ ctrl.person.display_name }} | ||
</md-chip> | ||
<md-chips ng-model="ctrl.persons" readonly="ctrl.readOnly" | ||
md-autocomplete-snap | ||
md-require-match="true"> | ||
<md-autocomplete | ||
md-selected-item="ctrl.selectedTag" | ||
md-selected-item-change="" | ||
md-search-text="ctrl.personQuery" | ||
md-search-text-change="" | ||
md-items="person in ctrl.findPersons(ctrl.personQuery)" | ||
md-item-text="personName" | ||
placeholder="Search for a person"> | ||
<md-item-template> | ||
<span md-highlight-text="ctrl.personQuery">{{ person.display_name || person.full_name }}</span> | ||
</md-item-template> | ||
<md-not-found> | ||
No matches found for "{{ ctrl.personQuery }}". | ||
</md-not-found> | ||
</md-autocomplete> | ||
<md-chip-template> | ||
<span> | ||
<strong>{{$chip}}</strong> | ||
</span> | ||
<span> | ||
<strong>{{ $chip.display_name || $chip.full_name }}</strong> | ||
</span> | ||
</md-chip-template> | ||
</md-chips> | ||
<md-autocomplete | ||
ng-hide="ctrl.readOnly" | ||
md-selected-item="ctrl.person" | ||
md-selected-item-change="ctrl.onPersonChange()" | ||
md-search-text="ctrl.personQuery" | ||
md-search-text-change="" | ||
md-items="person in ctrl.findPersons(ctrl.personQuery)" | ||
md-item-text="person.display_name" | ||
ng-hide="ctrl.readOnly" | ||
placeholder="Search for a person"> | ||
<md-item-template> | ||
<span md-highlight-text="ctrl.personQuery">{{ person.display_name }}</span> | ||
</md-item-template> | ||
<md-not-found> | ||
No matches found for "{{ ctrl.personQuery }}". | ||
</md-not-found> | ||
</md-autocomplete> | ||
</span> | ||
|
50 changes: 24 additions & 26 deletions
50
HadithHouseWebsite/hadiths/static/hadiths/html/tagselector.directive.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
<span> | ||
<md-chips ng-model="ctrl.tagNames" md-autocomplete-snap md-require-match> | ||
<md-autocomplete | ||
md-selected-item="ctrl.selectedTag" | ||
md-selected-item-change="" | ||
md-search-text="ctrl.tagQuery" | ||
md-search-text-change="" | ||
md-items="tagName in ctrl.findTagNames(ctrl.tagQuery)" | ||
md-item-text="tagName" | ||
ng-hide="ctrl.readOnly" | ||
placeholder="Search for a tag"> | ||
<md-item-template> | ||
<span md-highlight-text="ctrl.tagQuery">{{ tagName }}</span> | ||
</md-item-template> | ||
<md-not-found> | ||
No matches found for "{{ ctrl.tagQuery }}". | ||
</md-not-found> | ||
</md-autocomplete> | ||
<md-chip-template> | ||
<span> | ||
<strong>{{$chip}}</strong> | ||
</span> | ||
</md-chip-template> | ||
<md-icon md-chip-remove class="material-icons" ng-hide="ctrl.readOnly" | ||
style="vertical-align: middle; font-size: 14pt; font-weight: bold;">close | ||
</md-icon> | ||
</md-chips> | ||
<md-chips ng-model="ctrl.tagNames" readonly="ctrl.readOnly" | ||
md-autocomplete-snap | ||
md-require-match="true"> | ||
<md-autocomplete | ||
md-selected-item="ctrl.selectedTag" | ||
md-selected-item-change="" | ||
md-search-text="ctrl.tagQuery" | ||
md-search-text-change="" | ||
md-items="tagName in ctrl.findTagNames(ctrl.tagQuery)" | ||
md-item-text="tagName" | ||
placeholder="Search for a tag"> | ||
<md-item-template> | ||
<span md-highlight-text="ctrl.tagQuery">{{ tagName }}</span> | ||
</md-item-template> | ||
<md-not-found> | ||
No matches found for "{{ ctrl.tagQuery }}". | ||
</md-not-found> | ||
</md-autocomplete> | ||
<md-chip-template> | ||
<span> | ||
<strong>{{$chip}}</strong> | ||
</span> | ||
</md-chip-template> | ||
</md-chips> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters