Welcome to mirror list, hosted at ThFree Co, Russian Federation.

server_variables.js « src « js - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0ae788ad6ab1133fa8fe5b16b443afd85e4f2162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* vim: set expandtab sw=4 ts=4 sts=4: */

/**
 * Module import
 */
import { $ } from './utils/JqueryExtended';
import { editVariable } from './functions/Server/ServerVariables';

/**
 * @package PhpMyAdmin
 *
 * Server Variables
 */

/**
 * Unbind all event handlers before tearing down a page.
 */
function teardownServerVariables () {
    $(document).off('click', 'a.editLink');
    $('#serverVariables').find('.var-name').find('a img').remove();
}

/**
 * Binding event handlers on page load.
 */
function onloadServerVariables () {
    var $saveLink = $('a.saveLink');
    var $cancelLink = $('a.cancelLink');

    $('#serverVariables').find('.var-name').find('a').append(
        $('#docImage').clone().css('display', 'inline-block')
    );

    /* Launches the variable editor */
    $(document).on('click', 'a.editLink', function (event) {
        event.preventDefault();
        editVariable(this, $saveLink, $cancelLink);
    });
}

/**
 * Module export
 */
export {
    teardownServerVariables,
    onloadServerVariables
};