Permalink
Browse files

Fix an issue with filebrowser.js that occured when the dom_id query p…

…aram was missing
  • Loading branch information...
1 parent 4c2aaa2 commit f419f07e70ae85b38be20ecedcb0695240d0538c @pehlert committed Oct 21, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 app/assets/javascripts/rich/browser/filebrowser.js
@@ -36,9 +36,10 @@ rich.Browser.prototype = {
browser.selectStyle(def);
//check if we are inserting an object
- var split_field_name = $.QueryString["dom_id"].split('_');
+ var dom_id_param = $.QueryString["dom_id"];
+ var split_field_name = dom_id_param ? dom_id_param.split('_') : null;
- if(opt.length < 2 || split_field_name[split_field_name.length - 1] == "id") {
+ if(opt.length < 2 || (split_field_name && split_field_name[split_field_name.length - 1] == "id")) {
$('#styles').hide();
browser.selectStyle(opt[0]);
}

0 comments on commit f419f07

Please sign in to comment.