Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 27... Línea 27...
27
 
27
 
28
M.core_question_flags = {
28
M.core_question_flags = {
29
    flagattributes: null,
29
    flagattributes: null,
30
    actionurl: null,
30
    actionurl: null,
-
 
31
    listeners: [],
Línea 31... Línea 32...
31
    listeners: [],
32
    editableSelector: 'div.questionflag.editable',
32
 
33
 
33
    init: function(Y, actionurl, flagattributes) {
34
    init: function(Y, actionurl, flagattributes) {
Línea 34... Línea 35...
34
        M.core_question_flags.flagattributes = flagattributes;
35
        M.core_question_flags.flagattributes = flagattributes;
35
        M.core_question_flags.actionurl = actionurl;
36
        M.core_question_flags.actionurl = actionurl;
36
 
37
 
37
        Y.all('div.questionflag').each(function(flagdiv, i) {
38
        Y.all(M.core_question_flags.editableSelector).each(function(flagdiv) {
38
            var checkbox = flagdiv.one('input[type=checkbox]');
39
            var checkbox = flagdiv.one('input[type=checkbox]');
Línea 62... Línea 63...
62
        });
63
        });
Línea 63... Línea 64...
63
 
64
 
64
        Y.delegate('click', function(e) {
65
        Y.delegate('click', function(e) {
65
            e.halt();
66
            e.halt();
66
            M.core_question_flags.process(this);
67
            M.core_question_flags.process(this);
67
        }, document.body, 'div.questionflag');
68
        }, document.body, M.core_question_flags.editableSelector);
68
        Y.delegate('key', function(e) {
69
        Y.delegate('key', function(e) {
69
            e.halt();
70
            e.halt();
70
            if (e.keyCode == 13) {
71
            if (e.keyCode == 13) {
71
                M.core_question_flags.process(this);
72
                M.core_question_flags.process(this);
72
            }
73
            }
73
        }, document.body, 'down:enter, space', 'div.questionflag');
74
        }, document.body, 'down:enter, space', M.core_question_flags.editableSelector);
74
        Y.delegate('key', function(e) {
75
        Y.delegate('key', function(e) {
75
            e.halt();
76
            e.halt();
76
            M.core_question_flags.process(this);
77
            M.core_question_flags.process(this);
77
        }, document.body, 'up:space', 'div.questionflag');
78
        }, document.body, 'up:space', M.core_question_flags.editableSelector);
Línea 78... Línea 79...
78
    },
79
    },
79
 
80
 
80
    update_flag: function(input, toggle) {
81
    update_flag: function(input, toggle) {