summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2014-04-04 10:04:57 -0300
committerMarcello Coutinho <marcellocoutinho@gmail.com>2014-04-04 10:04:57 -0300
commit251a12460e1bf50d0c456c895c0c8a4bfadb49e3 (patch)
treeec1dce529337e4f6abb75a7b7e36fd01b9431289 /usr
parent2def89a2ddff8d7183a03c385fba8394c5bbf08e (diff)
downloadpfsense-251a12460e1bf50d0c456c895c0c8a4bfadb49e3.zip
pfsense-251a12460e1bf50d0c456c895c0c8a4bfadb49e3.tar.gz
fixes Bug #3569
On packages that uses row_helper when user clicks on add or delete button, the page scrolls to top. It seems something with ajax http://stackoverflow.com/questions/1061580/jquery-click-on-anchor-element-forces-scroll-to-top A simple return false after jquery action fixes the unwanted scroll.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/pkg_edit.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php
index a6e1299..0e8cb96 100755
--- a/usr/local/www/pkg_edit.php
+++ b/usr/local/www/pkg_edit.php
@@ -295,8 +295,10 @@ if ($pkg['custom_php_after_head_command'])
//delete current line jQuery function
jQuery('#maintable td .delete').live('click', function() {
//do not remove first line
- if (jQuery("#maintable tr").length > 2)
+ if (jQuery("#maintable tr").length > 2){
jQuery(this).parent().parent().remove();
+ return false;
+ }
});
//add new line jQuery function
@@ -306,6 +308,7 @@ if ($pkg['custom_php_after_head_command'])
var new_row=jQuery("table#maintable tr:last").html().replace(/(name|id)="(\w+)(\d+)"/g,"$1='$2"+c_id+"'");
//apply new id to created line rowhelperid
jQuery("table#maintable tr:last").after("<tr>"+new_row+"<\/tr>");
+ return false;
});
// Call enablechange function
enablechange();
OpenPOWER on IntegriCloud