Skip to content

Commit

Permalink
Merge pull request #5 from stevenharman/default-image-element
Browse files Browse the repository at this point in the history
Default image element
  • Loading branch information
Daryl Rowland committed Feb 13, 2014
2 parents 53ac65a + 0bc9abc commit 9e6ec01
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 318 deletions.
14 changes: 11 additions & 3 deletions angucomplete.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
.angucomplete-image-holder {
padding-top: 2px;
float: left;
height: 34px;
width: 34px;
margin-right: 10px;
margin-left: 5px;
}
Expand All @@ -69,4 +67,14 @@
border-color: #ececec;
border-style: solid;
border-width: 1px;
}
}

.angucomplete-image-default {
/* Add your own default image here
background-image: url('/assets/default.png');
*/
background-position: center;
background-size: contain;
height: 34px;
width: 34px;
}
2 changes: 1 addition & 1 deletion angucomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ angular.module('angucomplete', [] )
"minLengthUser": "@minlength",
"matchClass": "@matchclass"
},
template: '<div class="angucomplete-holder"><input id="{{id}}_value" ng-model="searchStr" type="text" placeholder="{{placeholder}}" class="{{inputClass}}" ng-keyup="keyPressed($event)"/><div id="{{id}}_dropdown" class="angucomplete-dropdown" ng-if="showDropdown"><div class="angucomplete-searching" ng-show="searching">Searching...</div><div class="angucomplete-searching" ng-show="!searching && (!results || results.length == 0)">No results found</div><div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseover="hoverRow()" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}"><div ng-if="result.image && result.image != \'\'" class="angucomplete-image-holder"><img ng-src="{{result.image}}" class="angucomplete-image"/></div><div ng-if="matchClass" ng-bind-html="result.title"></div><div ng-if="!matchClass">{{ result.title }}</div><div ng-if="result.description && result.description != \'\'" class="angucomplete-description">{{result.description}}</div></div></div></div>',
template: '<div class="angucomplete-holder"><input id="{{id}}_value" ng-model="searchStr" type="text" placeholder="{{placeholder}}" class="{{inputClass}}" ng-keyup="keyPressed($event)"/><div id="{{id}}_dropdown" class="angucomplete-dropdown" ng-if="showDropdown"><div class="angucomplete-searching" ng-show="searching">Searching...</div><div class="angucomplete-searching" ng-show="!searching && (!results || results.length == 0)">No results found</div><div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseover="hoverRow()" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}"><div ng-if="imageField" class="angucomplete-image-holder"><img ng-if="result.image && result.image != \'\'" ng-src="{{result.image}}" class="angucomplete-image"/><div ng-if="!result.image && result.image != \'\'" class="angucomplete-image-default"></div></div><div class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title"></div><div class="angucomplete-title" ng-if="!matchClass">{{ result.title }}</div><div ng-if="result.description && result.description != \'\'" class="angucomplete-description">{{result.description}}</div></div></div></div>',
controller: function ( $scope ) {
$scope.lastSearchTerm = null;
$scope.currentIndex = null;
Expand Down
72 changes: 0 additions & 72 deletions example/css/angucomplete.css

This file was deleted.

1 change: 1 addition & 0 deletions example/css/angucomplete.css
242 changes: 0 additions & 242 deletions example/js/app/directives/angucomplete.js

This file was deleted.

1 change: 1 addition & 0 deletions example/js/app/directives/angucomplete.js

0 comments on commit 9e6ec01

Please sign in to comment.