diff --git a/js/makegrid.js b/js/makegrid.js index a385681250..ad73ba416c 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -25,7 +25,8 @@ isEditCellTextEditable: false, // true if current edit cell is editable in the text input box (not textarea) currentEditCell: null, // reference to that currently being edited inEditMode: false, // true if grid is in edit mode - cellEditHint: '', // text hint when doing grid edit + cellEditHint: '', // hint shown when doing grid edit + gotoLinkText: 'Go to link', // "Go to link" text // functions dragStartRsz: function(e, obj) { // start column resize @@ -608,6 +609,15 @@ // empty all edit area, then rebuild it based on $td classes $editArea.empty(); + // add goto link, if this cell contains a link + if ($td.find('a').length > 0) { + var gotoLink = document.createElement('div'); + gotoLink.className = 'goto_link'; + $(gotoLink).append(g.gotoLinkText + ': ') + .append($td.find('a').clone()); + $editArea.append(gotoLink); + } + if ($td.is(':not(.not_null)')) { // append a null checkbox $editArea.append('
Null :
'); @@ -1227,6 +1237,10 @@ $(g.cEdit).find('input[type=text]').focus(); e.stopPropagation(); } + // prevent default action when clicking on "link" in a table + if ($(e.target).is('a')) { + e.preventDefault(); + } }); $(g.cEdit).find('input[type=text]').focus(function(e) { g.showEditArea(); diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 2a64ba84a8..b881bd421c 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -2473,7 +2473,7 @@ span.mysql-number { .cEdit .edit_area { background: #FFF; - border: 1px solid #CCC; + border: 1px solid #999; min-width: 10em; padding: 0.3em 0.5em; } @@ -2499,3 +2499,9 @@ span.mysql-number { padding-top: 1.5em; } +.cEdit .goto_link { + background: #EEE; + color: #555; + padding: 0.2em 0.3em; +} + diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index 8988d10da5..061090a01c 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -2884,7 +2884,7 @@ span.mysql-number { .cEdit .edit_area { background: #FFF; - border: 1px solid #CCC; + border: 1px solid #999; min-width: 10em; padding: 0.3em 0.5em; } @@ -2909,3 +2909,9 @@ span.mysql-number { padding-top: 1.5em; } +.cEdit .goto_link { + background: #EEE; + color: #555; + padding: 0.2em 0.3em; +} +