var self = this;
self.rootDiv.makeHorizPanel({}); // TODO: this probably doesn't belong into jQuery
- // self.rootDiv.css('top', ($('#header').outerHeight() ) + 'px');
+ // self.rootcDiv.css('top', ($('#header').outerHeight() ) + 'px');
$('#panels > *.panel-wrap').each(function() {
var panelWrap = $(this);
$('.panel-toolbar select', panelWrap).change(function() {
var url = $(this).val();
- panelWrap.data('ctrl').load(url);
self.savePanelOptions();
+ panelWrap.data('ctrl').load(url);
});
$('.panel-toolbar button.refresh-button', panelWrap).click(
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')
- )
+ $('.panel-toolbar option', this).each(function() {
+ if ($(this).attr('p:panel-name') == self.options.panels[index].name) {
+ $(this).parent('select').val($(this).attr('value'));
+ }
+ });
});
}
var panels = [];
$('.panel-wrap', self.rootDiv).not('.panel-content-overlay').each(function() {
panels.push({
- name: $('.panel-toolbar option:selected', this).attr('name'),
+ name: $('.panel-toolbar option:selected', this).attr('p:panel-name'),
ratio: $(this).width() / self.rootDiv.width()
})
});
<p><label>{{n|capfirst}} panel:
<select name="select-{{n}}-panel" id="panel-{{n}}-select">
{% for panel_type in availble_panels %}
- <option value="{% url panel_view path=fileid,name=panel_type.id %}">{{panel_type.display_name}}</option>
+ <option value="{% url panel_view path=fileid,name=panel_type.id %}" p:panel-name="{{ panel_type.id }}">{{panel_type.display_name}}</option>
{% endfor %}
</select>
</label>