return $(window).trigger('resize');
},
- parse_params : function (path, directive, mq) {
- return [this.trim(path), this.convert_directive(directive), this.trim(mq)];
- },
-
convert_directive : function (directive) {
var trimmed = this.trim(directive);
return 'replace';
},
+ parse_scenario : function (scenario) {
+ // This logic had to be made more complex since some users were using commas in the url path
+ // So we cannot simply just split on a comma
+ var directive_match = scenario[0].match(/(.+),\s*(\w+)\s*$/),
+ media_query = scenario[1];
+
+ if (directive_match) {
+ var path = directive_match[1],
+ directive = directive_match[2];
+ }
+ else {
+ var cached_split = scenario[0].split(/,\s*$/),
+ path = cached_split[0],
+ directive = '';
+ }
+
+ return [this.trim(path), this.convert_directive(directive), this.trim(media_query)];
+ },
+
object : function(el) {
var raw_arr = this.parse_data_attr(el),
scenarios = [],
var split = raw_arr[i].split(/\((.*?)(\))$/);
if (split.length > 1) {
- var cached_split = split[0].split(/\, /),
- params = this.parse_params(cached_split[0],
- cached_split[1], split[1]);
-
+ var params = this.parse_scenario(split);
scenarios.push(params);
}
}