object_id weirdoness fixed.
This commit is contained in:
parent
23f11bac52
commit
18291cd9ef
|
@ -2,7 +2,7 @@ from models import Module, ModuleTab
|
||||||
from django.shortcuts import render_to_response, get_object_or_404
|
from django.shortcuts import render_to_response, get_object_or_404
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
from ox.django.shortcuts import render_to_json_response
|
from ox.django.shortcuts import render_to_json_response
|
||||||
|
import re
|
||||||
|
|
||||||
def main(request, module_slug):
|
def main(request, module_slug):
|
||||||
m = get_object_or_404(Module, slug=module_slug)
|
m = get_object_or_404(Module, slug=module_slug)
|
||||||
|
@ -40,11 +40,11 @@ def get_tab(request):
|
||||||
|
|
||||||
|
|
||||||
def get_list(request):
|
def get_list(request):
|
||||||
|
numre = re.compile("[0-9]*")
|
||||||
tab_slug = request.GET.get("tab", "")
|
tab_slug = request.GET.get("tab", "")
|
||||||
tab = get_object_or_404(ModuleTab, slug=tab_slug)
|
tab = get_object_or_404(ModuleTab, slug=tab_slug)
|
||||||
object_id = request.GET.get("object_id", False)
|
object_id = request.GET.get("object_id", False)
|
||||||
if object_id.find("#") != -1:
|
object_id = object_id[numre.match(object_id).start():numre.match(object_id).end()] #FIXME - why is the front-end sending this?
|
||||||
object_id = object_id[0:object_id.find("#")] #FIXME - why is the front-end sending this?
|
|
||||||
sortString = request.GET.get("sort", "")
|
sortString = request.GET.get("sort", "")
|
||||||
if sortString == "" or sortString == 'null':
|
if sortString == "" or sortString == 'null':
|
||||||
sortArray = []
|
sortArray = []
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var queryData;
|
var queryData; //will store initial query data as a global var for submodule js to potentially use
|
||||||
|
|
||||||
$('.toggleBtn').live("click", function() {
|
$('.toggleBtn').live("click", function() {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
@ -10,7 +10,6 @@ $('.toggleBtn').live("click", function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#listLeft ul li a').live("click", function() {
|
$('#listLeft ul li a').live("click", function() {
|
||||||
if ($(this).hasClass("listLeftSelected")) {
|
if ($(this).hasClass("listLeftSelected")) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -399,7 +398,7 @@ function displayList(items) {
|
||||||
if (state.object_id == undefined || state.object_id == '') {
|
if (state.object_id == undefined || state.object_id == '') {
|
||||||
$('#listLeft ul li a').eq(0).click();
|
$('#listLeft ul li a').eq(0).click();
|
||||||
} else {
|
} else {
|
||||||
var $a = $('#listLeft ul li a[data-id=' + state.object_id + ']');
|
var $a = $('#listLeft ul li a[data-id=' + parseInt(state.object_id) + ']');
|
||||||
if ($a.length > 0) {
|
if ($a.length > 0) {
|
||||||
$a.click();
|
$a.click();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user