text: /*!
   * Copyright 2012 Sakai Foundation (SF) Licensed under the
   * Educational Community License, Version 2.0 (the "License"); you may
   * not use this file except in compliance with the License. You may
   * obtain a copy of the License at
   *
   *     http://www.osedu.org/licenses/ECL-2.0
   *
   * Unless required by applicable law or agreed to in writing,
   * software distributed under the License is distributed on an "AS IS"
   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
   * or implied. See the License for the specific language governing
   * permissions and limitations under the License.
   */
  
  define(
      [
          'jquery', 'underscore', 'oae.core'
      ],
      function ($, _, oae) {
  
          return function (uid, show, _data, callback) {
  
              // Properties
              var $rootel = $('#' + uid);
              var constants = _data.constants;
              var settings = _data.settings;
  
              /**
               * Build widget children
               */
              var initChildren = function() {
                  var data = {'currentUser': oae.data.me.displayName, 'settings': settings};
                  oae.api.util.template().render('#mobile-navigation-template',
                      data, $('#mobile-navigation-container', $rootel));
              };
  
              /**
               * Bind events to components
               */
              var addBinding = function() {
                  $('li').bind('click', onNavigationItemClick);
              };
  
              /**
               * When a navigation item gets clicked
               * @param {Event}   e                       The dispatched event
               * @param {Object}  e.currentTarget         The item that is clicked on
               */
              var onNavigationItemClick = function(e) {
                  var action = $(e.currentTarget).attr('data-action');
                  $(document).trigger(constants.events.activities.menuclicked, action);
              };
  
              /**
               * Initialize widget
               */
              var init = function() {
                  // Init children
                  initChildren();
                  // Add binding
                  addBinding();
              };
  
              init();
          };
      }
  );
  