Permalink
Browse files

Merge pull request #8 from FinalAngel/fixes/2685

Fixes/2685
  • Loading branch information...
digi604 committed Feb 27, 2014
2 parents 019c21c + 6047f5d commit 1f5db0c0e155014d6019f2766d05660173d603ae

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -88,8 +88,10 @@ $(document).ready(function () {
open: function (url, animate) {
// prepare iframe
var that = this;
+ var language = 'language=' + CMS.config.request.language;
+ var page_id = 'page_id=' + CMS.config.request.page_id;
var holder = this.sideframe.find('.cms_sideframe-frame');
- var iframe = $('<iframe src="'+url+'" class="" frameborder="0" />');
+ var iframe = $('<iframe src="'+this._url(url, [language, page_id])+'" class="" frameborder="0" />');
iframe.hide();
var width = this.settings.sideframe.position || this.options.sideframeWidth;
@@ -287,6 +289,47 @@ $(document).ready(function () {
this.sideframe.find('.cms_sideframe-shim').css('z-index', 1);
$(document).unbind('mousemove.cms');
+ },
+
+ _url: function (url, params) {
+ // return url if there is no param
+ if(url.split('?').length <= 1 || window.JSON === undefined) return url;
+ // setup local vars
+ var urlArray = url.split('?');
+ var urlParams = urlArray[1].split('&');
+ var origin = urlArray[0];
+ var arr = [];
+ var keys = [];
+ var values = [];
+ var tmp = '';
+
+ // loop through the available params
+ $.each(urlParams, function (index, param) {
+ arr.push({ 'param': param.split('=')[0], 'value': param.split('=')[1] });
+ });
+ // loop through the new params
+ $.each(params, function (index, param) {
+ arr.push({ 'param': param.split('=')[0], 'value': param.split('=')[1] });
+ });
+
+ // merge manually because jquery...
+ $.each(arr, function (index, item) {
+ if(keys.indexOf(item.param) === -1) {
+ keys.push(item.param);
+ values.push(item.value);
+ } else {
+ values[keys.indexOf(item.param)] = item.value;
+ }
+ });
+
+ // merge new url
+ $.each(keys, function (index, key) {
+ tmp += '&' + key + '=' + values[index];
+ });
+ tmp = tmp.replace('&', '?');
+ url = origin + tmp;
+
+ return url;
}
});
@@ -103,6 +103,9 @@ $color-background-blue-hover: #e6f6fd;
// edit button
.cont:hover .col1 a.changelink { display:block; }
+ // active state
+ .cont-active { background:lighten(#ffff99, 10%); }
+
// drag modus
li#dragged { min-width:500px; }
li#dragged .col2 { display:none; }
Oops, something went wrong.

0 comments on commit 1f5db0c

Please sign in to comment.