diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-02-27 04:22:39 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-02-27 04:22:39 +0100 |
commit | 02cd18d7165d86c7ea6d6fc6a9273094d9513a58 (patch) | |
tree | 815a4bc5a2b645cba4019a1114c9d07f202f9940 /extensions/MyDashboard/web | |
parent | 9fd6e94c03fa3bba09af2aed85d6664575385e9a (diff) | |
download | bugzilla-02cd18d7165d86c7ea6d6fc6a9273094d9513a58.tar.gz bugzilla-02cd18d7165d86c7ea6d6fc6a9273094d9513a58.tar.xz |
Show bug status and summary when mouseover bug ids in the flag lists
Diffstat (limited to 'extensions/MyDashboard/web')
-rw-r--r-- | extensions/MyDashboard/web/js/flags.js | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/extensions/MyDashboard/web/js/flags.js b/extensions/MyDashboard/web/js/flags.js index 925cb8b6a..e212466e8 100644 --- a/extensions/MyDashboard/web/js/flags.js +++ b/extensions/MyDashboard/web/js/flags.js @@ -10,8 +10,8 @@ YUI({ base: 'js/yui3/', combine: false -}).use("node", "datatable", "datatable-sort", "json-stringify", - "datatable-datasource", "datasource-io", "datasource-jsonschema", function (Y) { +}).use("node", "datatable", "datatable-sort", "json-stringify", "escape", + "datatable-datasource", "datasource-io", "datasource-jsonschema", function (Y) { // Common var counter = 0; var dataSource = { @@ -65,15 +65,20 @@ YUI({ }); }; + var bugLinkFormatter = function (o) { + return '<a href="show_bug.cgi?id=' + encodeURIComponent(o.value) + + ' target="_blank" ' + 'title="' + Y.Escape.html(o.data.bug_status) + ' - ' + + Y.Escape.html(o.data.bug_summary) + '">' + o.value + '</a>'; + }; + // Requestee dataSource.requestee = new Y.DataSource.IO({ source: 'jsonrpc.cgi' }); dataTable.requestee = new Y.DataTable({ columns: [ - { key:"requester", label:"Requester", sortable:true }, - { key:"type", label:"Flag", sortable:true }, - { key:"bug_id", label:"Bug", sortable:true, - formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>', allowHTML: true }, - { key:"created", label:"Created", sortable:true } + { key: "requester", label: "Requester", sortable: true }, + { key: "type", label: "Flag", sortable: true }, + { key: "bug_id", label: "Bug", sortable: true, formatter: bugLinkFormatter, allowHTML: true }, + { key: "created", label: "Created", sortable: true } ], strings: { emptyMessage: 'No flag data found.', @@ -90,7 +95,7 @@ YUI({ dataSource.requestee.plug(Y.Plugin.DataSourceJSONSchema, { schema: { resultListLocator: "result.result.requestee", - resultFields: ["requester", "type", "bug_id", "created"] + resultFields: ["requester", "type", "bug_id", "bug_status", "bug_summary", "created"] } }); @@ -106,8 +111,7 @@ YUI({ columns: [ { key:"requestee", label:"Requestee", sortable:true }, { key:"type", label:"Flag", sortable:true }, - { key:"bug_id", label:"Bug", sortable:true, - formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>', allowHTML: true }, + { key:"bug_id", label:"Bug", sortable:true, formatter: bugLinkFormatter, allowHTML: true }, { key:"created", label:"Created", sortable:true } ], strings: { @@ -125,7 +129,7 @@ YUI({ dataSource.requester.plug(Y.Plugin.DataSourceJSONSchema, { schema: { resultListLocator: "result.result.requester", - resultFields: ["requestee", "type", "bug_id", "created"] + resultFields: ["requestee", "type", "bug_id", "bug_status", "bug_summary", "created"] } }); |