Permalink
Browse files

MDL-32106: fixed JS bug - when html element did not exist the script …

…stopped
  • Loading branch information...
1 parent c856a1f commit 400d228e51b879582d93c5fa80aa2250711281e9 @marinaglancy marinaglancy committed Mar 20, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 repository/filepicker.js
View
6 repository/filepicker.js
@@ -669,13 +669,13 @@ M.core_filepicker.init = function(Y, options) {
params['author'] = author.get('value');
}
- if (this.options.env == 'editor') {
+ if (this.options.externallink && this.options.env == 'editor') {
// in editor, images are stored in '/' only
params.savepath = '/';
// when image or media button is clicked
if ( this.options.return_types != 1 ) {
- var linkexternal = Y.one('#linkexternal-'+client_id).get('checked');
- if (linkexternal) {
+ var linkexternal = Y.one('#linkexternal-'+client_id);
+ if (linkexternal && linkexternal.get('checked')) {
params['linkexternal'] = 'yes';
}
} else {

0 comments on commit 400d228

Please sign in to comment.