WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#5610 closed enhancement (fixed)

2.5 Toggle boxes should save

Reported by: matt Owned by: nbachiyski
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.5
Component: General Keywords: has-patch
Focuses: Cc:

Description

The toggle boxes recently added to the write page should save state.

They should save the state in an asynchronous (and possibly batched on unload?) fashion, and save it as box_id + state.

When the page is loaded, it should add the "closed" class to those post boxes which are marked as such in the user's prefs. That way there's no delay and then redrawing, it's all built in to the CSS.

Attachments (3)

save-postboxes-state.diff (3.8 KB) - added by nbachiyski 7 years ago.
cookies.js (717 bytes) - added by nbachiyski 7 years ago.
save-postboxes-state-usermeta.diff (8.3 KB) - added by nbachiyski 7 years ago.
This one saves the list of closed boxes in usermeta instead of in a cookie

Download all attachments as: .zip

Change History (7)

@nbachiyski7 years ago

comment:1 @nbachiyski7 years ago

Here is a patch, which saves in a cookie list of the id's of closed boxes and closes them on page load.

Since the cookie functions were already present in upload.js I took them out in cookies.js.

@nbachiyski7 years ago

This one saves the list of closed boxes in usermeta instead of in a cookie

comment:2 @nbachiyski7 years ago

New patch, which saves the list of closed boxes in usermeta.

comment:3 @lloydbudd7 years ago

  • Keywords has-patch added

Context for why cookie based solution discarded, matt:
"there's no reason to save it in a cookie. it's a permanent pref, not session or browser-based"

comment:4 @ryan7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6584]) Save toggle box open/closed state. Props nbachiyski. fixes #5610

Note: See TracTickets for help on using tickets.