~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to web/theme/default/js/xibo-forms.js

  • Committer: Dan Garner
  • Date: 2016-02-01 11:09:24 UTC
  • mfrom: (454.4.85)
  • Revision ID: git-v1:c2a7712fa4fd339a76780537fc77492c50667b9d
Merge pull request #135 from dasgarner/develop

Fixes for alpha3

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
        var color = $c.complement($("#layout").data().backgroundColor);
7
7
        
8
8
        // Apply the complementary color and a not to small font-size to the first paragraph of the editor
9
 
        $("#ta_text").val('<p style="color:' + color + '; font-size:48px;"></p>');
 
9
        $("#ta_text").val('<p style="color:' + color + ';"></p>');
10
10
 
11
11
        // Get the current template selected
12
12
        var templateId = $("#templateId").val();
336
336
 
337
337
    var backgroundImageList = $('#backgroundImageId');
338
338
    var backgroundImage = $('#bg_image_image');
 
339
    var initialBackgroundImageId = backgroundImageList.val();
 
340
    var backgroundChanged = false;
339
341
 
340
342
    function backgroundImageChange() {
341
343
        // Want to attach an onchange event to the drop down for the bg-image
348
350
            src = backgroundImage.data().url.replace(":id", id);
349
351
 
350
352
        backgroundImage.attr("src", src);
 
353
 
 
354
        if (id != initialBackgroundImageId)
 
355
            backgroundChanged = true;
351
356
    }
352
357
 
353
358
    backgroundImageList.change(backgroundImageChange);
371
376
                XiboSubmitResponse(xhr, form);
372
377
 
373
378
                if (xhr.success) {
374
 
                    var color = form.find("#backgroundColor").val();
375
 
                    $("#layout").data().backgroundColor = color;
376
 
                    $("#layout").css("background-color", color);
 
379
                    var layout = $("div#layout");
 
380
 
 
381
                    if (layout.length > 0) {
 
382
                        var color = form.find("#backgroundColor").val();
 
383
                        layout.data().backgroundColor = color;
 
384
                        layout.css("background-color", color);
 
385
 
 
386
                        if (backgroundChanged)
 
387
                            window.location.reload();
 
388
                    } else {
 
389
                        // On the layout page - call render
 
390
                        if (backgroundChanged && table != undefined)
 
391
                            table.ajax.reload(null, false);
 
392
                    }
377
393
                }
378
394
            },
379
395
            error: function(xhr, textStatus, errorThrown) {
388
404
    var grid = $("#permissionsTable").closest(".XiboGrid");
389
405
 
390
406
    var table = $("#permissionsTable").DataTable({ "language": dataTablesLanguage,
391
 
        serverSide: true,
 
407
        serverSide: true, stateSave: true,
392
408
        "filter": false,
393
409
        searchDelay: 3000,
394
410
        "order": [[ 0, "asc"]],
553
569
        container.data().media = {};
554
570
 
555
571
    var mediaTable = $("#mediaAssignments").DataTable({ "language": dataTablesLanguage,
556
 
            serverSide: true,
 
572
            serverSide: true, stateSave: true,
557
573
            searchDelay: 3000,
558
574
            "order": [[ 0, "asc"]],
559
575
            "filter": false,
665
681
        container.data().layout = {};
666
682
 
667
683
    var layoutTable = $("#layoutAssignments").DataTable({ "language": dataTablesLanguage,
668
 
        serverSide: true,
 
684
        serverSide: true, stateSave: true,
669
685
        searchDelay: 3000,
670
686
        "order": [[ 0, "asc"]],
671
687
        "filter": false,