Jeremy Newman : rewrite the ability for table rows to be clickable
Jeremy Newman
jnewman at winehq.org
Mon Nov 21 08:38:09 CST 2016
Module: appdb
Branch: master
Commit: 89e8e071fbec44c565d7d75def2a1baa1e52af99
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=89e8e071fbec44c565d7d75def2a1baa1e52af99
Author: Jeremy Newman <jnewman at codeweavers.com>
Date: Fri Nov 18 13:13:31 2016 -0600
rewrite the ability for table rows to be clickable
also removed some unused js functions
---
styles.css | 1 +
utils.js | 42 +++++++++++-------------------------------
2 files changed, 12 insertions(+), 31 deletions(-)
diff --git a/styles.css b/styles.css
index 9581b48..d9e4073 100644
--- a/styles.css
+++ b/styles.css
@@ -339,6 +339,7 @@ DIV.newsblock { margin: 0 5px 25px 10px; padding: 0; }
.clear { clear: both; }
.inline { display: inline-block; }
.small { font-size: 8pt; }
+.cursor-pointer { cursor: pointer; }
/* IMG options */
IMG { border: 0; text-decoration: none !important; }
diff --git a/utils.js b/utils.js
index bb76de9..e27cf80 100644
--- a/utils.js
+++ b/utils.js
@@ -55,6 +55,17 @@ $(document).ready(function()
});
});
+ // load table row by clicking anywhere on the row
+ $("table").find("tr[data-donav]").each(function()
+ {
+ var sURL = $(this).data('donav');
+ $(this).addClass('cursor-pointer');
+ $(this).click(function()
+ {
+ document.location = sURL;
+ });
+ });
+
// remove alert messages by clicking
$("#whq-alert").click(function(){ $(this).fadeOut("slow"); });
@@ -100,35 +111,4 @@ function openWin(fileToOpen,nameOfWindow,width,height) {
myWindow.document.close();
}
-// confirmation message (FIXME: replace with jquery utils: dialog)
-function deleteURL(text, url) {
- if (confirm(text)) {
- self.location = url;
- }
-}
-
-// row color change
-function ChangeTr(tableRow, bRowActive, sHighlightColor, sInactiveColor,
- sTextDecorationHighlight, sTextDecorationInactive)
-{
- if (bRowActive)
- {
- tableRow.style.backgroundColor = sHighlightColor;
- tableRow.style.cursor = "hand";
- tableRow.style.textDecoration = sTextDecorationHighlight;
- }
- else
- {
- tableRow.style.backgroundColor = sInactiveColor;
- tableRow.style.cursor = "pointer";
- tableRow.style.textDecoration = sTextDecorationInactive;
- }
-}
-
-// doNav
-function DoNav(sUrl)
-{
- document.location.href = sUrl;
-}
-
// done
\ No newline at end of file
More information about the wine-cvs
mailing list