Merge branch 'master' of github.com:zalun/FlightDeck

This commit is contained in:
Oskar Krawczyk 2010-03-05 00:16:38 +00:00
Родитель cdfa4a0746 eeca4526f0
Коммит ac471f74a4
3 изменённых файлов: 37 добавлений и 11 удалений

Просмотреть файл

@ -277,11 +277,13 @@ var CapVersion = new Class({
version_description: this.options.description,
});
// set as base functionality
if (!this.options.is_base) {
this.set_as_base_el = $(this.options.set_as_base_el);
this.set_as_base_el.addEvent('click', function(e) {
e.stop();
this.setAsBase();
}.bind(this));
}
},
/*
* Method: instantiateEditors

Просмотреть файл

@ -45,6 +45,30 @@ FlightDeck = Class.refactor(FlightDeck,{
// item is currently a global
// TODO: change to flightdeck parameter
return item;
},
/*
* Method: enableMenuButtons
* Switch on menu buttons, check if possible
*/
enableMenuButtons: function() {
$$('.' + this.options.menu_el + ' li.disabled').each(function(menuItem){
var switch_on = true;
if (!this.getItem().version.options.name) {
// version is not saved
switch_on = (
// check if it is not about set as base
!menuItem.hasChild(
this.getItem().version.options.set_as_base_el
)
// # TODO:
// check if content is empty
// check if user may update any content
);
}
if (switch_on) {
menuItem.removeClass('disabled');
}
}, this);
}
});

Просмотреть файл

@ -12,25 +12,25 @@
<a id="update" title="" href="#">Update <span class="UI_Editor_Icon"></span></a>
</li>
{% if version.is_base %}
<li class="UI_Editor_Menu_Button Icon_setAsBase">
<li class="UI_Editor_Menu_Button Icon_setAsBase disabled">
<a id="set_as_base" title="" href="#">Base version
<span class="UI_Editor_Icon"></span>
</a>
</li>
{% else %}
<li class="UI_Editor_Menu_Button Icon_setAsBase">
<li class="UI_Editor_Menu_Button Icon_setAsBase{% if not version %} disabled{% endif %}">
<a id="set_as_base" title="" href="#">Set as base
<span class="UI_Editor_Icon"></span>
</a>
</li>
{% endif %}
{% ifequal type "jetpack" %}{% if version %}
<li class="UI_Editor_Menu_Button Icon_try_in_browser">
{% ifequal type "jetpack" %}
<li class="UI_Editor_Menu_Button Icon_try_in_browser{% if not version %} disabled{% endif %}">
<a id="try_in_browser" title="" href="#">Try in browser
<span class="UI_Editor_Icon"></span>
</a>
</li>
{% endif %}{% endifequal %}
{% endifequal %}
{% comment %}
<li class="UI_Editor_Menu_Button Icon_lock">
<a title="" href="#">Lock <span class="UI_Editor_Icon"></span></a>