Welcome Guest, Not a member yet? Register   Sign In
template structure for tabbed modal
#2

(This post was last modified: 05-12-2015, 04:17 AM by sintakonte.)

don't know if i understand you correctly but try to create a javascript object something like:
Code:
(function (app, $, undefined) {

}(window.app = window.app || {}, jQuery));

app.autoLoad = function()    {

    app.modal.autoLoad();
}

app.modal = {
    autoLoad : function ()  {
        this.attachEventsToTabs();
    },

    attachEventsToTabs : function()
    {
        $("#my-modal").on($.modal.AJAX_COMPLETE, function(){
            //insert here your code for your tab clicks
            $("#tab-comments").on("click",function()    {
                $.get("/modal/comments/", function(data) {
                    
                    ....
                });
            })
        })
    }
}

$(document).ready(function()
{
    app.autoLoad();
});


with this version you are able to attach events to your tabs
and on the serverside you need one controller which handles your tab views

a modal controller sounds fine
Reply


Messages In This Thread
template structure for tabbed modal - by jhob - 05-11-2015, 01:17 PM
RE: template structure for tabbed modal - by sintakonte - 05-12-2015, 04:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB