Commit b80c02fd authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Set title attribute on view preview links

parent 8c65c976
...@@ -268,6 +268,7 @@ $string['listviews'] = 'List Views'; ...@@ -268,6 +268,7 @@ $string['listviews'] = 'List Views';
$string['nocopyableviewsfound'] = 'No Views that you can copy'; $string['nocopyableviewsfound'] = 'No Views that you can copy';
$string['noownersfound'] = 'No owners found'; $string['noownersfound'] = 'No owners found';
$string['displayingviewsby'] = 'Displaying Views by %s'; $string['displayingviewsby'] = 'Displaying Views by %s';
$string['Preview'] = 'Preview';
$string['closepreview'] = 'Close Preview'; $string['closepreview'] = 'Close Preview';
?> ?>
...@@ -61,6 +61,7 @@ if (!($group || $institution)) { ...@@ -61,6 +61,7 @@ if (!($group || $institution)) {
} }
View::get_templatesearch_data($views); View::get_templatesearch_data($views);
$strpreview = json_encode(get_string('Preview','view'));
$strclose = json_encode(get_string('closepreview','view')); $strclose = json_encode(get_string('closepreview','view'));
$js = <<<EOF $js = <<<EOF
preview = DIV({'id':'viewpreview', 'class':'hidden'}, DIV({'id':'viewpreviewinner'}, DIV({'id':'viewpreviewclose'}, A({'href':'','id':'closepreview'}, {$strclose})), DIV({'id':'viewpreviewcontent'}))); preview = DIV({'id':'viewpreview', 'class':'hidden'}, DIV({'id':'viewpreviewinner'}, DIV({'id':'viewpreviewclose'}, A({'href':'','id':'closepreview'}, {$strclose})), DIV({'id':'viewpreviewcontent'})));
...@@ -87,6 +88,7 @@ addLoadEvent(function() { ...@@ -87,6 +88,7 @@ addLoadEvent(function() {
templatelist.rewriteOther = function () { templatelist.rewriteOther = function () {
forEach(getElementsByTagAndClassName('a', 'viewlink', 'templatesearch'), function(i) { forEach(getElementsByTagAndClassName('a', 'viewlink', 'templatesearch'), function(i) {
disconnectAll(i); disconnectAll(i);
setNodeAttribute(i, 'title', {$strpreview});
connect(i, 'onclick', function (e) { connect(i, 'onclick', function (e) {
e.stop(); e.stop();
var href = getNodeAttribute(this, 'href'); var href = getNodeAttribute(this, 'href');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment