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.template import RequestContext
|
||||
from ox.django.shortcuts import render_to_json_response
|
||||
|
||||
import re
|
||||
|
||||
def main(request, module_slug):
|
||||
m = get_object_or_404(Module, slug=module_slug)
|
||||
|
@ -40,11 +40,11 @@ def get_tab(request):
|
|||
|
||||
|
||||
def get_list(request):
|
||||
numre = re.compile("[0-9]*")
|
||||
tab_slug = request.GET.get("tab", "")
|
||||
tab = get_object_or_404(ModuleTab, slug=tab_slug)
|
||||
object_id = request.GET.get("object_id", False)
|
||||
if object_id.find("#") != -1:
|
||||
object_id = object_id[0:object_id.find("#")] #FIXME - why is the front-end sending this?
|
||||
object_id = object_id[numre.match(object_id).start():numre.match(object_id).end()] #FIXME - why is the front-end sending this?
|
||||
sortString = request.GET.get("sort", "")
|
||||
if sortString == "" or sortString == 'null':
|
||||
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() {
|
||||
var $this = $(this);
|
||||
|
@ -10,7 +10,6 @@ $('.toggleBtn').live("click", function() {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
$('#listLeft ul li a').live("click", function() {
|
||||
if ($(this).hasClass("listLeftSelected")) {
|
||||
return false;
|
||||
|
@ -399,7 +398,7 @@ function displayList(items) {
|
|||
if (state.object_id == undefined || state.object_id == '') {
|
||||
$('#listLeft ul li a').eq(0).click();
|
||||
} 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) {
|
||||
$a.click();
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user