Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add submit button to redirect Load clipboard to View clipboard. (#1889) #1890

Open
wants to merge 1 commit into
base: qa/2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/qubit/modules/clipboard/templates/loadSuccess.php
Original file line number Diff line number Diff line change
@@ -37,7 +37,8 @@

<section class="actions">
<ul>
<li><input class="c-btn c-btn-submit" type="submit" value="<?php echo __('Load'); ?>"/></li>
<li><input class="c-btn c-btn-submit" name="load" type="submit" value="<?php echo __('Load'); ?>"/></li>
<li><input class="c-btn c-btn-submit" name="loadView" type="submit" value="<?php echo __('Load and view'); ?>"/></li>
</ul>
</section>

5 changes: 5 additions & 0 deletions js/clipboard.js
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@

var $form = $(event.target);
var mode = $form.find('select#mode').val();
var loadType = $(document.activeElement).attr("name");

$.ajax({
url: $form.attr('action'),
@@ -82,6 +83,10 @@
this.storage.setItem('clipboard', JSON.stringify(this.items));
this.updateCounts();
this.showAlert(data.success, 'alert-info');

if (loadType == "loadView") {
window.location.href = "/clipboard/view";
}
},
error: function(xhr)
{
5 changes: 5 additions & 0 deletions plugins/arDominionB5Plugin/js/clipboard.js
Original file line number Diff line number Diff line change
@@ -62,6 +62,7 @@ import Tooltip from "bootstrap/js/dist/tooltip";

var $form = $(event.target);
var mode = $form.find("select#mode").val();
var loadType = $(document.activeElement).attr("name");

$.ajax({
url: $form.attr("action"),
@@ -87,6 +88,10 @@ import Tooltip from "bootstrap/js/dist/tooltip";
this.storage.setItem("clipboard", JSON.stringify(this.items));
this.updateCounts();
this.showAlert(data.success, "alert-info");

if (loadType == "loadView") {
window.location.href = "/clipboard/view";
}
},
error: function (xhr) {
var data = JSON.parse(xhr.responseText);
Original file line number Diff line number Diff line change
@@ -33,9 +33,10 @@
</div>
</div>

<section class="actions mb-3">
<input class="btn atom-btn-outline-success" type="submit" value="<?php echo __('Load'); ?>">
</section>
<ul class="actions mb-3 nav gap-2">
<li><input class="btn atom-btn-outline-light" type="submit" name="load" value="<?php echo __('Load'); ?>"/></li>
<li><input class="btn atom-btn-outline-light" type="submit" name="loadView" value="<?php echo __('Load and view'); ?>"/></li>
</ul>

</form>