Project

General

Profile

Revision 70320f38

ID70320f3869f21ec0bf65cf15f4dd1421985edfc7
Parent b373a5de
Child f299be9c

Added by Aurelien BOMPARD about 13 years ago

Factorisation de l'utilisation des bibliothèques JS

git-svn-id: https://vigilo-dev.si.c-s.fr/svn@6851 b22e2e97-25c9-44ff-b637-2e5ceca36478

View differences:

vigiboard/public/js/autocompleter-vigilo.js
1
/**
2
 * Autocompleter.Request.VigiloJSON
3
 *
4
 */
5
Autocompleter.Request.VigiloJSON = new Class({
6

  
7
    Extends: Autocompleter.Request,
8

  
9
    options: {
10
        resVar: 'results'
11
    },
12

  
13
    initialize: function(el, url, options) {
14
        this.parent(el, options);
15
        this.request = new Request.JSON($merge({
16
            'url': url,
17
            'link': 'cancel'
18
        }, this.options.ajaxOptions)).addEvent('onComplete', this.queryResponse.bind(this));
19
    },
20

  
21
    queryResponse: function(response) {
22
        this.parent();
23
        this.update(response[this.options.resVar]);
24
    }
25

  
26
});

Also available in: Unified diff