diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2009-04-27 10:54:11 +0400 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2009-04-27 10:54:11 +0400 |
commit | a919eb4c38f83cec4385aeb0aac1e77437b7356d (patch) | |
tree | 7e7915c704de3f67567fadeeb718692781d754d5 /plugins/SitesManager/templates | |
parent | 27d504bbfee895d5725918fc7ef71e2e957a8517 (diff) |
fixing broken dashboard when loading old layout format from DB
Diffstat (limited to 'plugins/SitesManager/templates')
-rw-r--r-- | plugins/SitesManager/templates/SitesManager.js | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/plugins/SitesManager/templates/SitesManager.js b/plugins/SitesManager/templates/SitesManager.js index 48bcab165d..e21e7a2e2d 100644 --- a/plugins/SitesManager/templates/SitesManager.js +++ b/plugins/SitesManager/templates/SitesManager.js @@ -92,8 +92,7 @@ $(document).ready( function() { var idRow = $(this).attr('id'); var nameToDelete = $(this).parent().parent().find('#siteName').html(); var idsiteToDelete = $(this).parent().parent().find('#idSite').html(); - if(confirm(sprintf(_pk_translate('SitesManager_DeleteConfirm_js'),'"'+nameToDelete+'" (idSite = '+idsiteToDelete+')')) ) - { + if(confirm(sprintf(_pk_translate('SitesManager_DeleteConfirm_js'),'"'+nameToDelete+'" (idSite = '+idsiteToDelete+')')) ) { $.ajax( getDeleteSiteAJAX( idsiteToDelete ) ); } } @@ -102,38 +101,37 @@ $(document).ready( function() { var alreadyEdited = new Array; $('.editSite') .click( function() { - ajaxHideError(); - var idRow = $(this).attr('id'); - if(alreadyEdited[idRow]==1) return; - alreadyEdited[idRow] = 1; - $('tr#'+idRow+' .editableSite').each( - // make the fields editable - // change the EDIT button to VALID button - function (i,n) { - var contentBefore = $(n).html(); - var idName = $(n).attr('id'); - if(idName == 'siteName') - { - var contentAfter = '<input id="'+idName+'" value="'+contentBefore+'" size="25">'; - $(n) - .html(contentAfter) - .keypress( submitSiteOnEnter ); - } - if(idName == 'urls') - { - var contentAfter = '<textarea cols=30 rows=3 id="urls">'+contentBefore.replace(/<br *\/? *>/gi,"\n")+'</textarea>'; - $(n).html(contentAfter); - } - } - ); - - $(this) - .toggle() - .parent() - .prepend( $('<img src="plugins/UsersManager/images/ok.png" class="updateSite">') - .click( function(){ $.ajax( getUpdateSiteAJAX( $('tr#'+idRow) ) ); } ) - ); - } + ajaxHideError(); + var idRow = $(this).attr('id'); + if(alreadyEdited[idRow]==1) return; + alreadyEdited[idRow] = 1; + $('tr#'+idRow+' .editableSite').each( + // make the fields editable + // change the EDIT button to VALID button + function (i,n) { + var contentBefore = $(n).html(); + var idName = $(n).attr('id'); + if(idName == 'siteName') + { + var contentAfter = '<input id="'+idName+'" value="'+contentBefore+'" size="25">'; + $(n) + .html(contentAfter) + .keypress( submitSiteOnEnter ); + } + if(idName == 'urls') + { + var contentAfter = '<textarea cols=30 rows=3 id="urls">'+contentBefore.replace(/<br *\/? *>/gi,"\n")+'</textarea>'; + $(n).html(contentAfter); + } + } + ); + $(this) + .toggle() + .parent() + .prepend( $('<img src="plugins/UsersManager/images/ok.png" class="updateSite">') + .click( function(){ $.ajax( getUpdateSiteAJAX( $('tr#'+idRow) ) ); } ) + ); + } ); $('td.editableSite').click( function(){ $(this).parent().find('.editSite').click(); } ); |