Subversion Repositories SmartDukaan

Rev

Rev 37125 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37125 Rev 37692
Line 440... Line 440...
440
        },
440
        },
441
        refreshCommandCenter: refreshCommandCenter,
441
        refreshCommandCenter: refreshCommandCenter,
442
        refreshDashboards: refreshDashboards
442
        refreshDashboards: refreshDashboards
443
    };
443
    };
444
 
444
 
445
    // ---- sidebar menu entry points ----------------------------------------------
-
 
446
    // The LMS console is a full standalone page (own top-bar + 6 tabs, sts-mockup UI). To keep
-
 
447
    // the app's left sidebar + header visible, embed it in an iframe inside #main-content
-
 
448
    // (style/script isolated), deep-linked to the relevant tab.
-
 
449
    function openLmsConsole(hash) {
-
 
450
        var url = api('/lms/dashboard') + (hash || '');
-
 
451
        $('#main-content').html(
-
 
452
            '<iframe title="LMS Console" src="' + url + '" ' +
-
 
453
            'style="width:100%;height:calc(100vh - 92px);min-height:620px;border:0;display:block"></iframe>'
-
 
454
        );
-
 
455
    }
-
 
456
    $(document).on('click', '.lms-command-center', function (e) {
445
    $(document).on('click', '.lms-command-center', function (e) {
457
        if (e && e.preventDefault) e.preventDefault();
-
 
458
        openLmsConsole('#cmd');
446
        window.location.href = '/lms/dashboard#cmd';
459
    });
447
    });
460
    $(document).on('click', '.lms-dashboards', function (e) {
448
    $(document).on('click', '.lms-dashboards', function (e) {
461
        if (e && e.preventDefault) e.preventDefault();
-
 
462
        openLmsConsole('#dash');
449
        window.location.href = '/lms/dashboard#dash';
463
    });
450
    });
464
})();
451
})();