mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 18:51:12 +01:00
Conpherence - make updating title + picture a dialogue that uses drag and drop upload control
Summary: decent title. Stylistically its probably a bit rough. Also, I think @chad describes an even hotter workflow in T2418. Note this removes the "default image" thing which I don't think makes sense conceptually since by default the image changes to who replied last... Test Plan: uploaded an image - worked. uploaded a txt file - got ugly errors that file was not supported. Reviewers: epriestley, chad Reviewed By: chad CC: aran, Korvin Maniphest Tasks: T2417 Differential Revision: https://secure.phabricator.com/D4668
This commit is contained in:
parent
64543a9476
commit
9437bc019d
7 changed files with 144 additions and 117 deletions
|
@ -616,7 +616,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'aphront-error-view-css' =>
|
||||
array(
|
||||
'uri' => '/res/048ed376/rsrc/css/aphront/error-view.css',
|
||||
'uri' => '/res/5f43a7c5/rsrc/css/aphront/error-view.css',
|
||||
'type' => 'css',
|
||||
'requires' =>
|
||||
array(
|
||||
|
@ -1030,13 +1030,14 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'javelin-behavior-aphront-drag-and-drop' =>
|
||||
array(
|
||||
'uri' => '/res/84a67d72/rsrc/js/application/core/behavior-drag-and-drop.js',
|
||||
'uri' => '/res/3d809b40/rsrc/js/application/core/behavior-drag-and-drop.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
0 => 'javelin-behavior',
|
||||
1 => 'javelin-dom',
|
||||
2 => 'phabricator-drag-and-drop-file-upload',
|
||||
2 => 'phabricator-file-upload',
|
||||
3 => 'phabricator-drag-and-drop-file-upload',
|
||||
),
|
||||
'disk' => '/rsrc/js/application/core/behavior-drag-and-drop.js',
|
||||
),
|
||||
|
@ -3345,7 +3346,7 @@ celerity_register_resource_map(array(
|
|||
), array(
|
||||
'packages' =>
|
||||
array(
|
||||
'6031cfb4' =>
|
||||
'023adc14' =>
|
||||
array(
|
||||
'name' => 'core.pkg.css',
|
||||
'symbols' =>
|
||||
|
@ -3389,7 +3390,7 @@ celerity_register_resource_map(array(
|
|||
36 => 'phabricator-object-item-list-view-css',
|
||||
37 => 'global-drag-and-drop-css',
|
||||
),
|
||||
'uri' => '/res/pkg/6031cfb4/core.pkg.css',
|
||||
'uri' => '/res/pkg/023adc14/core.pkg.css',
|
||||
'type' => 'css',
|
||||
),
|
||||
'66dca903' =>
|
||||
|
@ -3469,7 +3470,7 @@ celerity_register_resource_map(array(
|
|||
'uri' => '/res/pkg/ec01d039/differential.pkg.css',
|
||||
'type' => 'css',
|
||||
),
|
||||
'ac53d36a' =>
|
||||
'310cd201' =>
|
||||
array(
|
||||
'name' => 'differential.pkg.js',
|
||||
'symbols' =>
|
||||
|
@ -3494,7 +3495,7 @@ celerity_register_resource_map(array(
|
|||
17 => 'javelin-behavior-differential-toggle-files',
|
||||
18 => 'javelin-behavior-differential-user-select',
|
||||
),
|
||||
'uri' => '/res/pkg/ac53d36a/differential.pkg.js',
|
||||
'uri' => '/res/pkg/310cd201/differential.pkg.js',
|
||||
'type' => 'js',
|
||||
),
|
||||
'c8ce2d88' =>
|
||||
|
@ -3579,22 +3580,22 @@ celerity_register_resource_map(array(
|
|||
'reverse' =>
|
||||
array(
|
||||
'aphront-attached-file-view-css' => 'e30a3fa8',
|
||||
'aphront-crumbs-view-css' => '6031cfb4',
|
||||
'aphront-dialog-view-css' => '6031cfb4',
|
||||
'aphront-error-view-css' => '6031cfb4',
|
||||
'aphront-form-view-css' => '6031cfb4',
|
||||
'aphront-crumbs-view-css' => '023adc14',
|
||||
'aphront-dialog-view-css' => '023adc14',
|
||||
'aphront-error-view-css' => '023adc14',
|
||||
'aphront-form-view-css' => '023adc14',
|
||||
'aphront-headsup-action-list-view-css' => 'ec01d039',
|
||||
'aphront-headsup-view-css' => '6031cfb4',
|
||||
'aphront-list-filter-view-css' => '6031cfb4',
|
||||
'aphront-pager-view-css' => '6031cfb4',
|
||||
'aphront-panel-view-css' => '6031cfb4',
|
||||
'aphront-table-view-css' => '6031cfb4',
|
||||
'aphront-tokenizer-control-css' => '6031cfb4',
|
||||
'aphront-tooltip-css' => '6031cfb4',
|
||||
'aphront-typeahead-control-css' => '6031cfb4',
|
||||
'aphront-headsup-view-css' => '023adc14',
|
||||
'aphront-list-filter-view-css' => '023adc14',
|
||||
'aphront-pager-view-css' => '023adc14',
|
||||
'aphront-panel-view-css' => '023adc14',
|
||||
'aphront-table-view-css' => '023adc14',
|
||||
'aphront-tokenizer-control-css' => '023adc14',
|
||||
'aphront-tooltip-css' => '023adc14',
|
||||
'aphront-typeahead-control-css' => '023adc14',
|
||||
'differential-changeset-view-css' => 'ec01d039',
|
||||
'differential-core-view-css' => 'ec01d039',
|
||||
'differential-inline-comment-editor' => 'ac53d36a',
|
||||
'differential-inline-comment-editor' => '310cd201',
|
||||
'differential-local-commits-view-css' => 'ec01d039',
|
||||
'differential-results-table-css' => 'ec01d039',
|
||||
'differential-revision-add-comment-css' => 'ec01d039',
|
||||
|
@ -3605,32 +3606,32 @@ celerity_register_resource_map(array(
|
|||
'differential-table-of-contents-css' => 'ec01d039',
|
||||
'diffusion-commit-view-css' => 'c8ce2d88',
|
||||
'diffusion-icons-css' => 'c8ce2d88',
|
||||
'global-drag-and-drop-css' => '6031cfb4',
|
||||
'global-drag-and-drop-css' => '023adc14',
|
||||
'inline-comment-summary-css' => 'ec01d039',
|
||||
'javelin-aphlict' => '66dca903',
|
||||
'javelin-behavior' => 'fbeded59',
|
||||
'javelin-behavior-aphlict-dropdown' => '66dca903',
|
||||
'javelin-behavior-aphlict-listen' => '66dca903',
|
||||
'javelin-behavior-aphront-basic-tokenizer' => '66dca903',
|
||||
'javelin-behavior-aphront-drag-and-drop' => 'ac53d36a',
|
||||
'javelin-behavior-aphront-drag-and-drop-textarea' => 'ac53d36a',
|
||||
'javelin-behavior-aphront-drag-and-drop' => '310cd201',
|
||||
'javelin-behavior-aphront-drag-and-drop-textarea' => '310cd201',
|
||||
'javelin-behavior-aphront-form-disable-on-submit' => '66dca903',
|
||||
'javelin-behavior-audit-preview' => 'f96657b8',
|
||||
'javelin-behavior-dark-console' => '8edbada5',
|
||||
'javelin-behavior-dark-console-ajax' => '8edbada5',
|
||||
'javelin-behavior-device' => '66dca903',
|
||||
'javelin-behavior-differential-accept-with-errors' => 'ac53d36a',
|
||||
'javelin-behavior-differential-add-reviewers-and-ccs' => 'ac53d36a',
|
||||
'javelin-behavior-differential-comment-jump' => 'ac53d36a',
|
||||
'javelin-behavior-differential-diff-radios' => 'ac53d36a',
|
||||
'javelin-behavior-differential-dropdown-menus' => 'ac53d36a',
|
||||
'javelin-behavior-differential-edit-inline-comments' => 'ac53d36a',
|
||||
'javelin-behavior-differential-feedback-preview' => 'ac53d36a',
|
||||
'javelin-behavior-differential-keyboard-navigation' => 'ac53d36a',
|
||||
'javelin-behavior-differential-populate' => 'ac53d36a',
|
||||
'javelin-behavior-differential-show-more' => 'ac53d36a',
|
||||
'javelin-behavior-differential-toggle-files' => 'ac53d36a',
|
||||
'javelin-behavior-differential-user-select' => 'ac53d36a',
|
||||
'javelin-behavior-differential-accept-with-errors' => '310cd201',
|
||||
'javelin-behavior-differential-add-reviewers-and-ccs' => '310cd201',
|
||||
'javelin-behavior-differential-comment-jump' => '310cd201',
|
||||
'javelin-behavior-differential-diff-radios' => '310cd201',
|
||||
'javelin-behavior-differential-dropdown-menus' => '310cd201',
|
||||
'javelin-behavior-differential-edit-inline-comments' => '310cd201',
|
||||
'javelin-behavior-differential-feedback-preview' => '310cd201',
|
||||
'javelin-behavior-differential-keyboard-navigation' => '310cd201',
|
||||
'javelin-behavior-differential-populate' => '310cd201',
|
||||
'javelin-behavior-differential-show-more' => '310cd201',
|
||||
'javelin-behavior-differential-toggle-files' => '310cd201',
|
||||
'javelin-behavior-differential-user-select' => '310cd201',
|
||||
'javelin-behavior-diffusion-commit-graph' => 'f96657b8',
|
||||
'javelin-behavior-diffusion-pull-lastmodified' => 'f96657b8',
|
||||
'javelin-behavior-error-log' => '8edbada5',
|
||||
|
@ -3647,14 +3648,14 @@ celerity_register_resource_map(array(
|
|||
'javelin-behavior-phabricator-home-reveal-tiles' => '66dca903',
|
||||
'javelin-behavior-phabricator-keyboard-shortcuts' => '66dca903',
|
||||
'javelin-behavior-phabricator-nav' => '66dca903',
|
||||
'javelin-behavior-phabricator-object-selector' => 'ac53d36a',
|
||||
'javelin-behavior-phabricator-object-selector' => '310cd201',
|
||||
'javelin-behavior-phabricator-oncopy' => '66dca903',
|
||||
'javelin-behavior-phabricator-remarkup-assist' => '66dca903',
|
||||
'javelin-behavior-phabricator-search-typeahead' => '66dca903',
|
||||
'javelin-behavior-phabricator-tooltips' => '66dca903',
|
||||
'javelin-behavior-phabricator-watch-anchor' => '66dca903',
|
||||
'javelin-behavior-refresh-csrf' => '66dca903',
|
||||
'javelin-behavior-repository-crossreference' => 'ac53d36a',
|
||||
'javelin-behavior-repository-crossreference' => '310cd201',
|
||||
'javelin-behavior-toggle-class' => '66dca903',
|
||||
'javelin-behavior-workflow' => '66dca903',
|
||||
'javelin-dom' => 'fbeded59',
|
||||
|
@ -3675,48 +3676,48 @@ celerity_register_resource_map(array(
|
|||
'javelin-util' => 'fbeded59',
|
||||
'javelin-vector' => 'fbeded59',
|
||||
'javelin-workflow' => 'fbeded59',
|
||||
'lightbox-attachment-css' => '6031cfb4',
|
||||
'lightbox-attachment-css' => '023adc14',
|
||||
'maniphest-task-summary-css' => 'e30a3fa8',
|
||||
'maniphest-transaction-detail-css' => 'e30a3fa8',
|
||||
'phabricator-busy' => '66dca903',
|
||||
'phabricator-content-source-view-css' => 'ec01d039',
|
||||
'phabricator-core-buttons-css' => '6031cfb4',
|
||||
'phabricator-core-css' => '6031cfb4',
|
||||
'phabricator-crumbs-view-css' => '6031cfb4',
|
||||
'phabricator-directory-css' => '6031cfb4',
|
||||
'phabricator-drag-and-drop-file-upload' => 'ac53d36a',
|
||||
'phabricator-core-buttons-css' => '023adc14',
|
||||
'phabricator-core-css' => '023adc14',
|
||||
'phabricator-crumbs-view-css' => '023adc14',
|
||||
'phabricator-directory-css' => '023adc14',
|
||||
'phabricator-drag-and-drop-file-upload' => '310cd201',
|
||||
'phabricator-dropdown-menu' => '66dca903',
|
||||
'phabricator-file-upload' => '66dca903',
|
||||
'phabricator-filetree-view-css' => '6031cfb4',
|
||||
'phabricator-flag-css' => '6031cfb4',
|
||||
'phabricator-form-view-css' => '6031cfb4',
|
||||
'phabricator-header-view-css' => '6031cfb4',
|
||||
'phabricator-jump-nav' => '6031cfb4',
|
||||
'phabricator-filetree-view-css' => '023adc14',
|
||||
'phabricator-flag-css' => '023adc14',
|
||||
'phabricator-form-view-css' => '023adc14',
|
||||
'phabricator-header-view-css' => '023adc14',
|
||||
'phabricator-jump-nav' => '023adc14',
|
||||
'phabricator-keyboard-shortcut' => '66dca903',
|
||||
'phabricator-keyboard-shortcut-manager' => '66dca903',
|
||||
'phabricator-main-menu-view' => '6031cfb4',
|
||||
'phabricator-main-menu-view' => '023adc14',
|
||||
'phabricator-menu-item' => '66dca903',
|
||||
'phabricator-nav-view-css' => '6031cfb4',
|
||||
'phabricator-nav-view-css' => '023adc14',
|
||||
'phabricator-notification' => '66dca903',
|
||||
'phabricator-notification-css' => '6031cfb4',
|
||||
'phabricator-notification-menu-css' => '6031cfb4',
|
||||
'phabricator-object-item-list-view-css' => '6031cfb4',
|
||||
'phabricator-notification-css' => '023adc14',
|
||||
'phabricator-notification-menu-css' => '023adc14',
|
||||
'phabricator-object-item-list-view-css' => '023adc14',
|
||||
'phabricator-object-selector-css' => 'ec01d039',
|
||||
'phabricator-paste-file-upload' => '66dca903',
|
||||
'phabricator-prefab' => '66dca903',
|
||||
'phabricator-project-tag-css' => 'e30a3fa8',
|
||||
'phabricator-remarkup-css' => '6031cfb4',
|
||||
'phabricator-shaped-request' => 'ac53d36a',
|
||||
'phabricator-side-menu-view-css' => '6031cfb4',
|
||||
'phabricator-standard-page-view' => '6031cfb4',
|
||||
'phabricator-remarkup-css' => '023adc14',
|
||||
'phabricator-shaped-request' => '310cd201',
|
||||
'phabricator-side-menu-view-css' => '023adc14',
|
||||
'phabricator-standard-page-view' => '023adc14',
|
||||
'phabricator-textareautils' => '66dca903',
|
||||
'phabricator-tooltip' => '66dca903',
|
||||
'phabricator-transaction-view-css' => '6031cfb4',
|
||||
'phabricator-zindex-css' => '6031cfb4',
|
||||
'sprite-apps-large-css' => '6031cfb4',
|
||||
'sprite-gradient-css' => '6031cfb4',
|
||||
'sprite-icon-css' => '6031cfb4',
|
||||
'sprite-menu-css' => '6031cfb4',
|
||||
'syntax-highlighting-css' => '6031cfb4',
|
||||
'phabricator-transaction-view-css' => '023adc14',
|
||||
'phabricator-zindex-css' => '023adc14',
|
||||
'sprite-apps-large-css' => '023adc14',
|
||||
'sprite-gradient-css' => '023adc14',
|
||||
'sprite-icon-css' => '023adc14',
|
||||
'sprite-menu-css' => '023adc14',
|
||||
'syntax-highlighting-css' => '023adc14',
|
||||
),
|
||||
));
|
||||
|
|
|
@ -65,9 +65,8 @@ abstract class ConpherenceController extends PhabricatorController {
|
|||
}
|
||||
|
||||
$unread_status = ConpherenceParticipationStatus::BEHIND;
|
||||
$unread_participant_query = id(new ConpherenceParticipantQuery())
|
||||
->withParticipantPHIDs(array($user->getPHID()));
|
||||
$unread = $unread_participant_query
|
||||
$unread = id(new ConpherenceParticipantQuery())
|
||||
->withParticipantPHIDs(array($user->getPHID()))
|
||||
->withParticipationStatus($unread_status)
|
||||
->execute();
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ final class ConpherenceUpdateController extends
|
|||
|
||||
$updated = false;
|
||||
$error_view = null;
|
||||
$e_image = null;
|
||||
$e_file = array();
|
||||
$errors = array();
|
||||
if ($request->isFormPost()) {
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
|
@ -100,37 +100,30 @@ final class ConpherenceUpdateController extends
|
|||
break;
|
||||
case 'metadata':
|
||||
$xactions = array();
|
||||
$default_image = $request->getExists('default_image');
|
||||
if ($default_image) {
|
||||
$image_phid = null;
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(ConpherenceTransactionType::TYPE_PICTURE)
|
||||
->setNewValue($image_phid);
|
||||
} else if (!empty($_FILES['image'])) {
|
||||
$err = idx($_FILES['image'], 'error');
|
||||
if ($err != UPLOAD_ERR_NO_FILE) {
|
||||
$file = PhabricatorFile::newFromPHPUpload(
|
||||
$_FILES['image'],
|
||||
array(
|
||||
'authorPHID' => $user->getPHID(),
|
||||
));
|
||||
$okay = $file->isTransformableImage();
|
||||
if ($okay) {
|
||||
$xformer = new PhabricatorImageTransformer();
|
||||
$xformed = $xformer->executeThumbTransform(
|
||||
$file,
|
||||
$x = 50,
|
||||
$y = 50);
|
||||
$image_phid = $xformed->getPHID();
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(ConpherenceTransactionType::TYPE_PICTURE)
|
||||
->setNewValue($image_phid);
|
||||
} else {
|
||||
$e_image = pht('Not Supported');
|
||||
$errors[] =
|
||||
pht('This server only supports these image formats: %s.',
|
||||
$images = $request->getArr('image');
|
||||
if ($images) {
|
||||
// just take the first one
|
||||
$file_phid = reset($images);
|
||||
$file = id(new PhabricatorFileQuery())
|
||||
->setViewer($user)
|
||||
->withPHIDs(array($file_phid))
|
||||
->executeOne();
|
||||
$okay = $file->isTransformableImage();
|
||||
if ($okay) {
|
||||
$xformer = new PhabricatorImageTransformer();
|
||||
$xformed = $xformer->executeThumbTransform(
|
||||
$file,
|
||||
$x = 50,
|
||||
$y = 50);
|
||||
$image_phid = $xformed->getPHID();
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(ConpherenceTransactionType::TYPE_PICTURE)
|
||||
->setNewValue($image_phid);
|
||||
} else {
|
||||
$e_file[] = $file;
|
||||
$errors[] =
|
||||
pht('This server only supports these image formats: %s.',
|
||||
implode(', ', $supported_formats));
|
||||
}
|
||||
}
|
||||
}
|
||||
$title = $request->getStr('title');
|
||||
|
@ -169,6 +162,7 @@ final class ConpherenceUpdateController extends
|
|||
if ($errors) {
|
||||
$error_view = id(new AphrontErrorView())
|
||||
->setTitle(pht('Errors editing conpherence.'))
|
||||
->setInsideDialogue(true)
|
||||
->setErrors($errors);
|
||||
}
|
||||
|
||||
|
@ -190,29 +184,26 @@ final class ConpherenceUpdateController extends
|
|||
)
|
||||
)
|
||||
->appendChild(
|
||||
id(new AphrontFormImageControl())
|
||||
id(new AphrontFormDragAndDropUploadControl())
|
||||
->setLabel(pht('Change Image'))
|
||||
->setName('image')
|
||||
->setValue($e_file)
|
||||
->setCaption('Supported formats: '.implode(', ', $supported_formats))
|
||||
->setError($e_image)
|
||||
);
|
||||
);
|
||||
|
||||
// TODO -- fix javelin so we can upload files from a workflow
|
||||
require_celerity_resource('conpherence-update-css');
|
||||
return $this->buildStandardPageResponse(
|
||||
array(
|
||||
$error_view,
|
||||
return id(new AphrontDialogResponse())
|
||||
->setDialog(
|
||||
id(new AphrontDialogView())
|
||||
->setUser($user)
|
||||
->setTitle(pht('Update Conpherence'))
|
||||
->setWidth(AphrontDialogView::WIDTH_FORM)
|
||||
->setSubmitURI($this->getApplicationURI('update/'.$conpherence_id.'/'))
|
||||
->addHiddenInput('action', 'metadata')
|
||||
->appendChild($error_view)
|
||||
->appendChild($form)
|
||||
->addSubmitButton()
|
||||
->addCancelButton($this->getApplicationURI($conpherence->getID().'/')),
|
||||
),
|
||||
array()
|
||||
);
|
||||
->addCancelButton($this->getApplicationURI($conpherence->getID().'/'))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,11 +69,12 @@ final class ConpherenceViewController extends
|
|||
$edit_href = $this->getApplicationURI('update/'.$conpherence->getID().'/');
|
||||
|
||||
$header =
|
||||
phutil_render_tag(
|
||||
javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'class' => 'edit',
|
||||
'href' => $edit_href,
|
||||
'sigil' => 'workflow',
|
||||
),
|
||||
''
|
||||
).
|
||||
|
|
|
@ -11,6 +11,15 @@ final class AphrontErrorView extends AphrontView {
|
|||
private $errors;
|
||||
private $severity;
|
||||
private $id;
|
||||
private $insideDialogue;
|
||||
|
||||
public function setInsideDialogue($inside_dialogue) {
|
||||
$this->insideDialogue = $inside_dialogue;
|
||||
return $this;
|
||||
}
|
||||
public function getInsideDialogue() {
|
||||
return $this->insideDialogue;
|
||||
}
|
||||
|
||||
public function setTitle($title) {
|
||||
$this->title = $title;
|
||||
|
@ -32,6 +41,15 @@ final class AphrontErrorView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
private function getBaseClass() {
|
||||
if ($this->getInsideDialogue()) {
|
||||
$class = 'aphront-error-view-dialogue';
|
||||
} else {
|
||||
$class = 'aphront-error-view';
|
||||
}
|
||||
return $class;
|
||||
}
|
||||
|
||||
final public function render() {
|
||||
|
||||
require_celerity_resource('aphront-error-view-css');
|
||||
|
@ -69,15 +87,16 @@ final class AphrontErrorView extends AphrontView {
|
|||
|
||||
$this->severity = nonempty($this->severity, self::SEVERITY_ERROR);
|
||||
|
||||
$more_classes = array();
|
||||
$more_classes[] = 'aphront-error-severity-'.$this->severity;
|
||||
$more_classes = implode(' ', $more_classes);
|
||||
$classes = array();
|
||||
$classes[] = $this->getBaseClass();
|
||||
$classes[] = 'aphront-error-severity-'.$this->severity;
|
||||
$classes = implode(' ', $classes);
|
||||
|
||||
return phutil_render_tag(
|
||||
'div',
|
||||
array(
|
||||
'id' => $this->id,
|
||||
'class' => 'aphront-error-view '.$more_classes,
|
||||
'class' => $classes,
|
||||
),
|
||||
$title.
|
||||
phutil_render_tag(
|
||||
|
|
|
@ -2,12 +2,19 @@
|
|||
* @provides aphront-error-view-css
|
||||
*/
|
||||
|
||||
.aphront-error-view {
|
||||
margin: 20px;
|
||||
.aphront-error-view,
|
||||
.aphront-error-view-dialogue {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.aphront-error-view {
|
||||
margin: 20px;
|
||||
}
|
||||
.aphront-error-view-dialogue {
|
||||
margin: 0px 0px 16px 0px;
|
||||
}
|
||||
|
||||
.device-phone .aphront-error-view {
|
||||
margin: 10px;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* @provides javelin-behavior-aphront-drag-and-drop
|
||||
* @requires javelin-behavior
|
||||
* javelin-dom
|
||||
* phabricator-file-upload
|
||||
* phabricator-drag-and-drop-file-upload
|
||||
*/
|
||||
|
||||
|
@ -16,7 +17,15 @@ JX.behavior('aphront-drag-and-drop', function(config) {
|
|||
// Show the control, since we have browser support.
|
||||
JX.$(config.control).style.display = '';
|
||||
|
||||
var files = config.value || {};
|
||||
var files = {};
|
||||
if (config.value) {
|
||||
for (var k in config.value) {
|
||||
var file = config.value[k];
|
||||
files[k] = new JX.PhabricatorFileUpload()
|
||||
.setPHID(file.phid)
|
||||
.setMarkup(file.html);
|
||||
}
|
||||
}
|
||||
var pending = 0;
|
||||
|
||||
var list = JX.$(config.list);
|
||||
|
|
Loading…
Reference in a new issue