+
+ this.loadPanelOptions();
+}
+
+Editor.prototype.loadPanelOptions = function() {
+ var self = this;
+ var totalWidth = 0;
+
+ $('.panel-wrap', self.rootDiv).each(function(index) {
+ var panelWidth = self.options.panels[index].ratio * self.rootDiv.width();
+ if ($(this).hasClass('last-panel')) {
+ $(this).css({
+ left: totalWidth,
+ right: 0,
+ });
+ } else {
+ $(this).css({
+ left: totalWidth,
+ width: panelWidth,
+ });
+ totalWidth += panelWidth;
+ }
+ $.log('panel:', this, $(this).css('left'));
+ $('.panel-toolbar select', this).val(
+ $('.panel-toolbar option[name=' + self.options.panels[index].name + ']', this).attr('value')
+ )
+ });
+}
+
+Editor.prototype.savePanelOptions = function() {
+ var self = this;
+ var panels = [];
+ $('.panel-wrap', self.rootDiv).not('.panel-content-overlay').each(function() {
+ panels.push({
+ name: $('.panel-toolbar option:selected', this).attr('name'),
+ ratio: $(this).width() / self.rootDiv.width()
+ })
+ });
+ self.options.panels = panels;
+ $.log($.toJSON(self.options));
+ $.cookie('options', $.toJSON(self.options), { expires: 7, path: '/'});