File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ function setInitialState() {
8181 chrome . storage . sync . get ( {
8282 baseUrl : "https://www.stackoverflow.com/search?q=" ,
8383 shouldOpenInSameTab : true ,
84+ sortOrder : 0 ,
8485 questionsWithCodeFilter : false ,
8586 communityWikisFilter : false ,
8687 excludeDuplicateQuestionsFilter : false ,
@@ -93,6 +94,9 @@ function setInitialState() {
9394 } else {
9495 document . getElementById ( 'new_tab_result' ) . checked = true ;
9596 }
97+
98+ document . getElementById ( 'sort_order' ) . value = items . sortOrder ;
99+
96100 document . getElementById ( 'question_with_code' ) . checked = items . questionsWithCodeFilter ;
97101 document . getElementById ( 'community_wikis' ) . checked = items . communityWikisFilter ;
98102 document . getElementById ( 'exclude_duplicate_questions' ) . checked = items . excludeDuplicateQuestionsFilter ;
@@ -166,6 +170,13 @@ function setListeners() {
166170 showSavedAlert ( ) ;
167171 } ) ;
168172 } ) ;
173+ $ ( "#sort_order" ) . on ( "change" , function ( ) {
174+ chrome . storage . sync . set ( {
175+ sortOrder : this . value
176+ } , function ( ) {
177+ showSavedAlert ( ) ;
178+ } ) ;
179+ } ) ;
169180 $ ( "#question_with_code" ) . on ( "change" , function ( ) {
170181 chrome . storage . sync . set ( {
171182 questionsWithCodeFilter : this . checked
You can’t perform that action at this time.
0 commit comments