From 9e6c548c511877820d8f60e1ada09bc47e455bb9 Mon Sep 17 00:00:00 2001 From: phamt Date: Wed, 10 Nov 2010 17:14:08 +0000 Subject: [PATCH] Changed comments icon to be larger and added Cancel link to undo changes. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8119 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/images/ui-icon-comment.png | Bin 0 -> 1000 bytes xCAT-UI/js/nodes/nodes.js | 47 ++++++++++++++++++++++++----- 2 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 xCAT-UI/images/ui-icon-comment.png diff --git a/xCAT-UI/images/ui-icon-comment.png b/xCAT-UI/images/ui-icon-comment.png new file mode 100644 index 0000000000000000000000000000000000000000..f3944770c8b03ba793f561d071a36b4fb18a0b4f GIT binary patch literal 1000 zcmV>P)+B888dM z^Cmu81y|ZE7<>&C;)=k%6u_Z&QH;j#;bJ5Z00^W3P%<0q&LcSrFp|I*F8YNa`+Pxo zlAiAZ9C`(Yo#36iK})i;5SXC~M`v++=SfjDfLI)0EGY)?c9C!dqPpC)hIzfNH(`w6C2ZxQMqR(M)&v-%C-QQjb5S$%vH|+t;~DQ zcK(-|8N@YH?6NU3$^&N6r4or-Gv9hfZ;0ewUO+5jCKw7p*vyc;b2dNYUXaxP%(h{; zr#I-tz-EdXo5F$#L!0LJKB@pX63Sf<7DA*KoN*N!J%uJe=mG*T=3Lr|0Y-))g2uE3 zu5_%ykh5V;+*9Cz#t$2bd0AjE~%M|$st~pT@URSf4 zP)$*&1u{dKD=PO%;2i9@qd${KkqPm59Af=n+W2Vn*~rJ%4?VZfy~X1_s2?`o!Jv@I z04b3kg#U~a3{T0HvZCWx>iv1ktJ9E*05UYt`we2h`d+9tp|yLkCg?r7q{nbsy#*h!6n%^PQ9fwJd zKd)$QVSP(ou&`o3jxyaE8aV6=XWy90%&Y)Zs(WxcYh^V;VQ%%ws>Qn+8>sGoPt!7X zr)ZfIK>0N>v8FsgFYAbmRdG?ngUZmFZ5O5j(C0i*JbkC^su;nyHU#R%_bLDREx-WE Wk=v;F8@nk00000'); + icon = $('').css({ + 'width': '18px', + 'height': '18px' + }); // Create tooltip tip = createCommentsToolTip(comments); @@ -1862,7 +1865,7 @@ function createCommentsToolTip(comments) { var toolTip = $('
'); // Create textarea to hold comments var txtArea = $('').css({ - 'font-size': '12px', + 'font-size': '10px', 'height': '50px', 'width': '200px', 'background-color': '#000', @@ -1870,13 +1873,26 @@ function createCommentsToolTip(comments) { 'border': '0px' }); - // Create link to save changes - var saveLnk = $('Save').css('color', '#58ACFA'); + // Create links to save and cancel changes + var saveLnk = $('Save'); + saveLnk.css({ + 'color': '#58ACFA', + 'font-size': '10px', + 'display' : 'inline-block', + 'padding' : '5px' + }); saveLnk.hide(); + var cancelLnk = $('Cancel'); + cancelLnk.css({ + 'color': '#58ACFA', + 'font-size': '10px', + 'display' : 'inline-block', + 'padding' : '5px' + }); + cancelLnk.hide(); + + // Save changes onclick saveLnk.bind('click', function(){ - // Hide save link - $(this).hide(); - // Get node and comments var node = $(this).parent().parent().find('span').attr('id').replace('Tip', ''); var comments = $(this).parent().find('textarea').val(); @@ -1894,15 +1910,32 @@ function createCommentsToolTip(comments) { success: showChtabOutput }); + + // Hide cancel and save links + $(this).hide(); + cancelLnk.hide(); + }); + + // Cancel changes onclick + cancelLnk.bind('click', function(){ + // Get original comments and put it back + var orignComments = $(this).parent().find('textarea').text(); + $(this).parent().find('textarea').val(orignComments); + + // Hide cancel and save links + $(this).hide(); + saveLnk.hide(); }); // Show save link when comments is edited txtArea.bind('click', function(){ saveLnk.show(); + cancelLnk.show(); }); toolTip.append(txtArea); toolTip.append(saveLnk); + toolTip.append(cancelLnk); return toolTip; }