mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backup MDL-23727 The proceed button is now to the right of the screen…
… and the cancel button throws a confirmation box.
- Loading branch information
Sam Hemelryk
committed
Aug 17, 2010
1 parent
baf8b9b
commit 83a9c86
Showing
4 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
YUI.add('moodle-backup-confirmcancel', function(Y) { | ||
|
||
// Namespace for the backup | ||
M.core_backup = M.core_backup || {}; | ||
/** | ||
* Adds confirmation dialogues to the cancel buttons on the page. | ||
* | ||
* @param {object} config | ||
*/ | ||
M.core_backup.watch_cancel_buttons = function(config) { | ||
Y.all('.confirmcancel').each(function(){ | ||
this._confirmationListener = this._confirmationListener || this.on('click', function(e){ | ||
// Prevent the default event (sumbit) from firing | ||
e.preventDefault(); | ||
// Create the confirm box | ||
var confirm = new M.core.confirm(config); | ||
// If the user clicks yes | ||
confirm.on('complete-yes', function(e){ | ||
// Detach the listener for the confirm box so it doesn't fire again. | ||
this._confirmationListener.detach(); | ||
// Simulate the original cancel button click | ||
this.simulate('click'); | ||
}, this); | ||
// Show the confirm box | ||
confirm.show(); | ||
}, this); | ||
}); | ||
} | ||
|
||
}, '@VERSION@', {'requires':['base','node','moodle-enrol-notification']}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters