summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2018-09-02 09:47:07 -0600
committerluxagraf <sng@luxagraf.net>2018-09-02 09:47:07 -0600
commit800264daff5f4dc123a66fee068a19677eaa1170 (patch)
tree622020e265c3a82db9aa5e76faf81badca607e83
parent140ee80f0fe1d1d48f67612c1389ca7c2fc94f71 (diff)
changed jrnl featured_image widget to load all, but only preview first
100
-rw-r--r--app/jrnl/admin.py2
-rw-r--r--app/utils/static/image-loader.js6
2 files changed, 4 insertions, 4 deletions
diff --git a/app/jrnl/admin.py b/app/jrnl/admin.py
index ac950df..bebe1ef 100644
--- a/app/jrnl/admin.py
+++ b/app/jrnl/admin.py
@@ -15,7 +15,7 @@ class EntryAdmin(OSMGeoAdmin):
form = LGEntryForm
def render_change_form(self, request, context, *args, **kwargs):
- context['adminform'].form.fields['featured_image'].queryset = LuxImage.objects.all()[:200]
+ #context['adminform'].form.fields['featured_image'].queryset = LuxImage.objects.all()[:200]
return super(EntryAdmin, self).render_change_form(request, context, *args, **kwargs)
def formfield_for_dbfield(self, db_field, **kwargs):
diff --git a/app/utils/static/image-loader.js b/app/utils/static/image-loader.js
index 0139f10..f68da83 100644
--- a/app/utils/static/image-loader.js
+++ b/app/utils/static/image-loader.js
@@ -8,10 +8,10 @@ function add_images(){
if (featured_image) {
featured_image.querySelectorAll('li').forEach(function(element) {
var cur = element.dataset.imageid;
- var loop = element.dataset.loopcounter;
- console.log(loop);
- if (loop <= 100) {
+ var loop = Number(element.dataset.loopcounter);
if (cur != "") {
+ if (loop <= 100) {
+ console.log(loop);
var request = new XMLHttpRequest();
request.open('GET', '/photos/luximage/data/admin/tn/'+cur+'/', true);
request.onload = function() {