Skip to content

Commit

Permalink
Fix init version form bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonweng committed May 16, 2018
1 parent 0f1275f commit ae62055
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion views/themes/publish2/assets/javascripts/publish2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions views/themes/publish2/assets/javascripts/publish2/publish2.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,16 @@
$types = $action.find('[data-action-type]'),
$slideoutForm = $('.qor-slideout__body form'),
$bottomsheetForm = $('.qor-bottomsheets__body form'),
isInBottomsheets = $action.closest('.qor-bottomsheets').length,
isInSlideout = $action.closest('.qor-slideout').length,
$parent,
element = QorPublish2.ELEMENT;

// move publsh2 actions into slideout form tag
if ($action.length) {
if ($bottomsheetForm.length) {
if ($bottomsheetForm.length && isInBottomsheets) {
$action.prependTo($bottomsheetForm.first());
} else if ($slideoutForm.length) {
} else if ($slideoutForm.length && isInSlideout) {
$action.prependTo($slideoutForm.first());
}
}
Expand All @@ -264,9 +267,16 @@
return;
}

if (isInSlideout) {
$parent = $('.qor-slideout');
} else if (isInBottomsheets) {
$parent = $('.qor-bottomsheets');
}

$types.each(function() {
var $this = $(this);
$(element[$this.data('actionType')])
$parent
.find(element[$this.data('actionType')])
.closest('.qor-form-section')
.hide();
});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ae62055

Please sign in to comment.