You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/11/08 01:49:39 UTC

[GitHub] Antonio-Maranhao commented on a change in pull request #1103: Customize style of the results list

Antonio-Maranhao commented on a change in pull request #1103: Customize style of the results list
URL: https://github.com/apache/couchdb-fauxton/pull/1103#discussion_r231740509
 
 

 ##########
 File path: app/addons/documents/index-results/reducers.js
 ##########
 @@ -61,9 +62,34 @@ const initialState = {
   }
 };
 
+function loadStyle() {
+  let style = app.utils.localStorageGet('fauxton:results_style');
+  if (!style) {
+    style = {
+      textOverflow: Constants.INDEX_RESULTS_STYLE.TEXT_OVERFLOW_TRUNCATED,
+      fontSize: Constants.INDEX_RESULTS_STYLE.FONT_SIZE_MEDIUM
+    };
+  }
+  return style;
+}
+
+function storeStyle(style) {
+  app.utils.localStorageSet('fauxton:results_style', style);
+}
+
 export default function resultsState(state = initialState, action) {
   switch (action.type) {
 
+    case ActionTypes.INDEX_RESULTS_SET_STYLE:
+      const newStyle = {
+        ...state.resultsStyle,
+        ...action.resultsStyle
+      };
+      storeStyle(newStyle);
+      return Object.assign({}, state, {
+        resultsStyle: newStyle
 
 Review comment:
   Updated... using the spread op in all actions

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services