Structure some code for replication.js and tbl_operation.js

Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
This commit is contained in:
Piyush Vijay 2018-09-20 05:24:35 +05:30
parent 074c5063ab
commit b5824ef13e
No known key found for this signature in database
GPG Key ID: FC77A75558658D35
2 changed files with 10 additions and 4 deletions

View File

@ -12,6 +12,7 @@ import { escapeHtml } from './utils/Sanitise';
import { PMA_prepareForAjaxRequest } from './functions/AjaxRequest';
import { PMA_sprintf } from './utils/sprintf';
import { getJSConfirmCommonParam } from './functions/Common';
import { PMA_reloadNavigation } from './functions/navigation';
/**
* @fileoverview function used in server privilege pages
@ -74,7 +75,7 @@ export function onloadDbOperations () {
PMA_reloadNavigation(function () {
$('#pma_navigation_tree')
.find('a:not(\'.expander\')')
.each(function (index) {
.each(function () {
var $thisAnchor = $(this);
if ($thisAnchor.text() === data.newname) {
// simulate a click on the new db name

View File

@ -1,7 +1,12 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/* Module Import */
import { PMA_messages as PMA_messages } from './variables/export_variables';
import { PMA_ajaxShowMessage } from './utils/show_ajax_messages';
import { AJAX } from './ajax';
/**
* for server_replication.php
*
*/
var random_server_id = Math.floor(Math.random() * 10000000);
var conf_prefix = 'server-id=' + random_server_id + '\nlog_bin=mysql-bin\nlog_error=mysql-bin.err\n';
@ -29,7 +34,7 @@ function update_config () {
/**
* Unbind all event handlers before tearing down a page
*/
export function teardown1 () {
export function teardownReplication () {
$('#db_type').off('change');
$('#db_select').off('change');
$('#master_status_href').off('click');
@ -43,7 +48,7 @@ export function teardown1 () {
$('#reset_slave').off('click');
}
export function onload1 () {
export function onloadReplication () {
$('#rep').text(conf_prefix);
$('#db_type').on('change', update_config);
$('#db_select').on('change', update_config);