1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Fix custom field selector control in cases where the user doesn't edit anything

Summary: The JS and PHP representations of state can differ; just have the JS write the state out immediately on page load.

Test Plan: Saved `diffusion.fields` without making changes, reloaded, saw no effective change.

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D12998
This commit is contained in:
epriestley 2015-05-25 05:34:23 -07:00
parent f0d16b3047
commit 969a6a2b38
3 changed files with 11 additions and 13 deletions

View file

@ -333,7 +333,7 @@ return array(
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
'rsrc/js/application/calendar/behavior-day-view.js' => '5c46cff2',
'rsrc/js/application/calendar/behavior-event-all-day.js' => '38dcf3c8',
'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de',
'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '10246726',
'rsrc/js/application/conpherence/behavior-drag-and-drop-photo.js' => 'cf86d16a',
'rsrc/js/application/conpherence/behavior-durable-column.js' => '16c695bf',
@ -543,7 +543,7 @@ return array(
'javelin-behavior-audio-source' => '59b251eb',
'javelin-behavior-audit-preview' => 'd835b03a',
'javelin-behavior-choose-control' => '6153c708',
'javelin-behavior-config-reorder-fields' => '14a827de',
'javelin-behavior-config-reorder-fields' => 'b6993408',
'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a',
'javelin-behavior-conpherence-menu' => 'c0348cac',
'javelin-behavior-conpherence-pontificate' => '21ba5861',
@ -907,13 +907,6 @@ return array(
'javelin-dom',
'javelin-history',
),
'14a827de' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-dom',
'javelin-json',
'phabricator-draggable-list',
),
'14ac66f5' => array(
'javelin-install',
'javelin-dom',
@ -1728,6 +1721,13 @@ return array(
'javelin-dom',
'javelin-util',
),
'b6993408' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-dom',
'javelin-json',
'phabricator-draggable-list',
),
'ba4fa35c' => array(
'javelin-behavior',
'javelin-dom',

View file

@ -12,9 +12,6 @@ final class PhabricatorCustomFieldConfigOptionType
$storage_value = $request->getStr('value');
$in_value = phutil_json_decode($storage_value);
if (!is_array($in_value)) {
$in_value = array();
}
// When we submit from JS, we submit a list (since maps are not guaranteed
// to retain order). Convert it into a map for storage (since it's far more
@ -113,7 +110,7 @@ final class PhabricatorCustomFieldConfigOptionType
'id' => $input_id,
'type' => 'hidden',
'name' => 'value',
'value' => json_encode($display_value),
'value' => '',
));
Javelin::initBehavior(

View file

@ -54,4 +54,5 @@ JX.behavior('config-reorder-fields', function(config) {
JX.$(config.inputID).value = JX.JSON.stringify(order);
};
write_state_to_form();
});