Skip to content

Commit

Permalink
content search input now defaults to latest content
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Callens committed Jun 30, 2015
1 parent ce5e33a commit 0007279
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="form-group" ng-class="{'has-error': !isFieldValid(navItemForm.name)}">
<label>^loc_NAME^</label>
<input type="text" name="name" class="form-control" ng-model="navItem.name" required></input>
<div class="form_error" ng-if="!isFieldValid(navItemForm.type)">^loc_REQUIRED_FIELD^</div>
<div class="form_error" ng-if="!isFieldValid(navItemForm.name)">^loc_REQUIRED_FIELD^</div>
</div>
<div class="form-group">
<label>^loc_DESCRIPTION^</label>
Expand Down
16 changes: 8 additions & 8 deletions public/js/admin/elements/content_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $(document).ready(function() {
order: 'headline'
},
success: function(data) {
response( $.map( data.data, function( item ) {
response($.map(data.data, function(item) {
return {
value: item._id,
label: item.headline
Expand All @@ -39,16 +39,16 @@ $(document).ready(function() {
});
},
minLength: 0,
select: function( event, ui ) {
select: function(event, ui) {
setItem(ui.item.value);
$(this).val(ui.item.label);
return false;
},
open: function() {
//$( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
},
close: function() {
//$( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
}
});

// Forces the source call to be made on input focus
input.bind('focus', function(event) {
var keydownEvent = $.Event('keydown');
input.trigger(keydownEvent);
});
});

0 comments on commit 0007279

Please sign in to comment.