ffff
This commit is contained in:
23
module.js
23
module.js
@@ -45,18 +45,23 @@ M.mod_programming.init_history = function(Y) {
|
||||
var r = Y.all('.diff1');
|
||||
if (r.size() > 0) {
|
||||
var firstDiff = r.item(0);
|
||||
if (firstDiff) {
|
||||
if (firstDiff && firstDiff.hide) {
|
||||
firstDiff.hide();
|
||||
}
|
||||
}
|
||||
r = Y.all('.diff2');
|
||||
if (r.size() > 0) {
|
||||
var lastDiff = r.item(r.size() - 1);
|
||||
if (lastDiff) {
|
||||
if (lastDiff && lastDiff.hide) {
|
||||
lastDiff.hide();
|
||||
}
|
||||
}
|
||||
|
||||
var historyForm = Y.one('#history-diff-form');
|
||||
if (!historyForm) {
|
||||
return;
|
||||
}
|
||||
|
||||
var is_history_diff_form_submitable = function() {
|
||||
var f1 = false, f2 = false;
|
||||
Y.all('.diff1').each(function(node) {
|
||||
@@ -71,11 +76,14 @@ M.mod_programming.init_history = function(Y) {
|
||||
return f1 && f2 && f1.get('value') != f2.get('value');
|
||||
};
|
||||
|
||||
Y.one('#history-diff-form').on('submit', is_history_diff_form_submitable);
|
||||
historyForm.on('submit', is_history_diff_form_submitable);
|
||||
|
||||
Y.all('#history-diff-form input[type=radio]').each(function(node) {
|
||||
historyForm.all('input[type=radio]').each(function(node) {
|
||||
node.on('change', function() {
|
||||
var btn = Y.one('#history-diff-form input[type=submit]');
|
||||
var btn = historyForm.one('input[type=submit]');
|
||||
if (!btn) {
|
||||
return;
|
||||
}
|
||||
if (is_history_diff_form_submitable()) {
|
||||
btn.removeAttribute('disabled');
|
||||
} else {
|
||||
@@ -84,7 +92,10 @@ M.mod_programming.init_history = function(Y) {
|
||||
});
|
||||
});
|
||||
|
||||
Y.one('#history-diff-form input[type=submit]').setAttribute('disabled', true);
|
||||
var submitBtn = historyForm.one('input[type=submit]');
|
||||
if (submitBtn) {
|
||||
submitBtn.setAttribute('disabled', true);
|
||||
}
|
||||
};
|
||||
|
||||
M.mod_programming.init_reports_detail = function(Y) {
|
||||
|
||||
Reference in New Issue
Block a user