Skip to content

Commit

Permalink
refs owncloud#368: Use custom search box
Browse files Browse the repository at this point in the history
  • Loading branch information
rstefko committed Jul 2, 2023
1 parent 98b0a00 commit a9417dc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
6 changes: 6 additions & 0 deletions css/notes.css
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,9 @@
padding-left: 90px;
}
}

#searchnotes {
width: 100%;
border-left: 0px;
padding-left: 12px;
}
10 changes: 1 addition & 9 deletions js/app/controllers/notescontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ app.controller('NotesController', function($routeParams, $scope, $location,
});
};

var searchform = $('.searchbox');
var searchbox = $('#searchbox');
var searchbox = $('#searchnotes');

initSearch();

Expand All @@ -59,13 +58,6 @@ app.controller('NotesController', function($routeParams, $scope, $location,
}, 250);
searchbox.bind('propertychange change keyup input paste', checkQueryChange);

/** Handle clearing the searchbox. This has to be registered to the parent form
* of the #searchbox element.
*/
searchform.on('reset', function() {
setQueryString('');
});

/** Run search when enter pressed within the searchbox */
searchbox.bind('keydown', function (event) {
if (event.which === 13) {
Expand Down
7 changes: 4 additions & 3 deletions templates/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
oc-click-focus="{ selector: '#app-content textarea' }">
<a href='#'>+ <span><?php p($l->t('New note')); ?></span></a>
</li>
<!-- search notes button -->
<li>
<input id="searchnotes" type="search" name="searchnotes" value="" autocomplete="off" placeholder="Search in notes" />
</li>
<!-- notes list -->
<li ng-repeat="note in notes|orderBy:['-favorite','-modified']|noteFilter:queryString"
ng-class="{ active: note.id == route.noteId }">
Expand Down Expand Up @@ -67,7 +71,4 @@
<div id="app-content" ng-class="{loading: is.loading}">
<div id="app-content-container" ng-view></div>
</div>

<!-- Show search button in header -->
<div id="searchresults" class="hidden" data-appfilter="notes"></div>
</div>

0 comments on commit a9417dc

Please sign in to comment.