Skip to content

Commit

Permalink
Update javascript libraries; provide a generic table-row click handling
Browse files Browse the repository at this point in the history
  • Loading branch information
arlen committed Dec 5, 2019
1 parent 715ac35 commit 597892d
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 24 deletions.
2 changes: 1 addition & 1 deletion app/src/Template/Element/breadcrumbs.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ if($this->request->getRequestTarget(false) != '/') {
$target
);
}

if(!empty($vv_title)) {
$this->Breadcrumbs->add(
$vv_title
Expand Down
6 changes: 5 additions & 1 deletion app/src/Template/Element/javascript.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
// Preserve the state of the most recently selected menu item if it is expandable (a "menuTop" item)
// (we only use this behavior when the the drawer is fully-open)
var mainMenuSelectedParentId = Cookies.get("main-menu-selected-parent-id");
console.log(mainMenuSelectedParentId);
if(mainMenuSelectedParentId != undefined && mainMenuSelectedParentId != "") {
$("#" + mainMenuSelectedParentId).addClass("active");
$("#" + mainMenuSelectedParentId + " > a.menuTop").attr("aria-expanded","true");
Expand Down Expand Up @@ -202,6 +201,11 @@
}
});

// Generic table-row click handling
$('tr.linked-row').click(function (e) {
location.href = $(this).find('a.row-link').attr('href');
});

// Add a spinner when a form is submitted or when any item is clicked with a "spin" class
$("input[type='submit'], .spin").click(function() {

Expand Down
8 changes: 4 additions & 4 deletions app/src/Template/Layout/default.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ if(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'M

<!-- Load CSS -->
<?= $this->Html->css([
'bootstrap/bootstrap-4.3.1.min',
'bootstrap/bootstrap-4.4.1.min',
'jquery/jquery-ui-1.12.1.custom/jquery-ui.min',
'jquery/metisMenu/metisMenu-2.5.2.min.css',
'jquery/metisMenu/metisMenu-3.0.4.min.css',
'fonts/Font-Awesome-4.6.3/css/font-awesome.min', // XXX Font-Awesome only used for login/logout icon; replace???
'co-base',
'co-responsive'
Expand Down Expand Up @@ -153,9 +153,9 @@ if(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'M
<!-- Load Javascript -->
<?= $this->Html->script([
'jquery/jquery-3.3.1.min.js',
'bootstrap/bootstrap-4.3.1.min',
'bootstrap/bootstrap-4.4.1.min',
'jquery/jquery-ui-1.12.1.custom/jquery-ui.min.js',
'jquery/metisMenu/metisMenu-2.5.2.min.js',
'jquery/metisMenu/metisMenu-3.0.4.min.js',
'js-cookie/js.cookie-2.1.3.min.js',
'jquery/spin/spin.min.js',
'jquery/noty/jquery.noty.js',
Expand Down
8 changes: 6 additions & 2 deletions app/src/Template/Matchgrids/pending.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,16 @@ declare(strict_types = 1);
<th><?= __('match.fd.request_time'); ?></th>
</tr>
<?php foreach($vv_pending as $p): ?>
<tr>
<tr class="linked-row spin">
<td>
<?= $p['sor']; ?>
</td>
<td>
<?= $this->Html->link($p['sorid'], ['action' => 'reconcile', $vv_matchgrid_id, 'rowid' => $p['id']]); ?>
<?= $this->Html->link(
$p['sorid'],
['action' => 'reconcile', $vv_matchgrid_id, 'rowid' => $p['id']],
['class' => 'row-link']
); ?>
</td>
<td>
<?= $p['request_time']; ?>
Expand Down
7 changes: 0 additions & 7 deletions app/webroot/css/bootstrap/bootstrap-4.3.1.min.css

This file was deleted.

7 changes: 7 additions & 0 deletions app/webroot/css/bootstrap/bootstrap-4.4.1.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/webroot/css/bootstrap/bootstrap.min.css.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,12 @@ tr:nth-child(even) td {
td.indented {
border-left: 3em solid #fff;
}
tr.linked-row {
cursor: pointer;
}
tr.linked-row:hover td {
background-color: #ffe;
}
.menuitembutton {
width: 250px;
}
Expand Down
7 changes: 0 additions & 7 deletions app/webroot/js/bootstrap/bootstrap-4.3.1.min.js

This file was deleted.

7 changes: 7 additions & 0 deletions app/webroot/js/bootstrap/bootstrap-4.4.1.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/webroot/js/bootstrap/bootstrap.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/webroot/js/comanage.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ function stopSpinner() {
$("#coSpinner").remove();
}


// Returns an i18n string with tokens replaced.
// For use in JavaScript dialogs.
// text - body text for the array with tokens {0}, {1}, etc
Expand Down Expand Up @@ -225,4 +224,5 @@ function limitPage(pageLimit,recordCount,currentPage) {

// Redirect to the new page:
window.location = currentUrl;
}
}

0 comments on commit 597892d

Please sign in to comment.