@@ -109,6 +109,7 @@ function update_buttons() {
109109 update_single_button ( selection_size > 0 , $ ( '#sort_az-notes-button' ) , 'Sort' , 'A → Z' )
110110 update_single_button ( selection_size > 0 , $ ( '#sort_za-notes-button' ) , 'Sort' , 'Z → A' )
111111 update_single_button ( selection_size > 0 , $ ( '#sort_sl-notes-button' ) , 'Sort' , 'Short → Long' )
112+ update_single_button ( selection_size > 0 , $ ( '#sort_ls-notes-button' ) , 'Sort' , 'Long → Short' )
112113 update_single_button ( selection_size > 0 , $ ( '#number-notes-button' ) , 'Number' )
113114
114115 // if (selection_size > 1) {
@@ -226,6 +227,16 @@ $('#sort_sl-notes-button').click(() => {
226227 sorted_list = note_elements_to_array ( selection ) . sort ( ( a , b ) => a . length - b . length ) ;
227228 replace_note_elements ( selection , sorted_list ) ;
228229} ) ;
230+ // Short to long sort
231+ $ ( '#sort_ls-notes-button' ) . click ( ( ) => {
232+ selection = $ ( 'li.selected' ) ;
233+ record_event ( {
234+ 'type' : 'sort_ls' ,
235+ 'items' : selection
236+ } ) ;
237+ sorted_list = note_elements_to_array ( selection ) . sort ( ( a , b ) => a . length - b . length ) . reverse ( ) ;
238+ replace_note_elements ( selection , sorted_list ) ;
239+ } ) ;
229240// Reverse alphabetical sort
230241$ ( '#number-notes-button' ) . click ( ( ) => {
231242 selection = $ ( 'li.selected' ) ;
0 commit comments