fixed active line #88
This commit is contained in:
parent
e9e9fa54b2
commit
0dde1738cf
@ -68,6 +68,11 @@ class Slide(object):
|
|||||||
self.weight = weight
|
self.weight = weight
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def active(self):
|
||||||
|
from api import get_active_slide
|
||||||
|
return get_active_slide(True) == self.key
|
||||||
|
|
||||||
def get_items(self):
|
def get_items(self):
|
||||||
try:
|
try:
|
||||||
return self.model.objects.all()
|
return self.model.objects.all()
|
||||||
|
@ -2,7 +2,7 @@ $(function() {
|
|||||||
// activate an element to show it on projector
|
// activate an element to show it on projector
|
||||||
$('.activate_link').click(function(event) {
|
$('.activate_link').click(function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
link = $(this);
|
var link = $(this);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: $(this).attr('href'),
|
url: $(this).attr('href'),
|
||||||
@ -12,6 +12,7 @@ $(function() {
|
|||||||
$('.activate_link').removeClass('active');
|
$('.activate_link').removeClass('active');
|
||||||
$('li').removeClass('activeline');
|
$('li').removeClass('activeline');
|
||||||
link.addClass('active');
|
link.addClass('active');
|
||||||
|
link.parent().addClass('activeline');
|
||||||
},
|
},
|
||||||
error: function () {
|
error: function () {
|
||||||
alert("Ajax Error");
|
alert("Ajax Error");
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
<ul style="line-height: 180%">
|
<ul style="line-height: 180%">
|
||||||
<li>
|
<li class="{% if slides.active %}activeline{% endif %}">
|
||||||
<a href="{% url projector_activate_slide slides.key %}" class="activate_link {% if slides.active %}active{% endif %}">
|
<a href="{% url projector_activate_slide slides.key %}" class="activate_link {% if slides.active %}active{% endif %}">
|
||||||
<div></div>
|
<div></div>
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user