rbrindley: branch rbrindley/vmenus_revamp r4435 - in /team/rbrindley/vmenus_r...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Thu Jan 15 12:27:43 CST 2009


Author: rbrindley
Date: Thu Jan 15 12:27:42 2009
New Revision: 4435

URL: http://svn.digium.com/svn-view/asterisk-gui?view=rev&rev=4435
Log:

- optmized by replacing 'find' with 'children' in addAction
- added addVmenu function
- removed the 'new' link from the tabs navigation list to just above it
- removed #vmenu_new div
- removed the place holder #vmenu_6000 tab (and div)
- added tabs defaults for untitled1 div html and selected js variable
- fixed an issue where selected was failing as a jQuery selector because it was missing the '#'
- fixed an issue with the vmenu_template by narrowing its selector scope


Modified:
    team/rbrindley/vmenus_revamp/config/js/menus2.js
    team/rbrindley/vmenus_revamp/config/menus2.html

Modified: team/rbrindley/vmenus_revamp/config/js/menus2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/vmenus_revamp/config/js/menus2.js?view=diff&rev=4435&r1=4434&r2=4435
==============================================================================
--- team/rbrindley/vmenus_revamp/config/js/menus2.js (original)
+++ team/rbrindley/vmenus_revamp/config/js/menus2.js Thu Jan 15 12:27:42 2009
@@ -30,12 +30,12 @@
  }
 
  function addAction(action_id) {
-	var vmenu = $(selected).find('.vmenu');
+	var vmenu = $(selected).children('.vmenu');
 	var new_vmenu = vmenu_template.clone();
 	var action = actions[action_id];
 
-	new_vmenu.find('.command').html(action.command);
-	new_vmenu.find('.name').html(action.name);
+	new_vmenu.children('.command').html(action.command);
+	new_vmenu.children('.name').html(action.name);
 	new_vmenu.removeClass('template');
 	vmenu.append(new_vmenu);
 
@@ -58,3 +58,6 @@
 		i=i+2;
 	});
  }
+
+ function addVmenu(e, ui) {
+ }

Modified: team/rbrindley/vmenus_revamp/config/menus2.html
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/vmenus_revamp/config/menus2.html?view=diff&rev=4435&r1=4434&r2=4435
==============================================================================
--- team/rbrindley/vmenus_revamp/config/menus2.html (original)
+++ team/rbrindley/vmenus_revamp/config/menus2.html Thu Jan 15 12:27:42 2009
@@ -228,13 +228,12 @@
 	<div id="vmenus_edit_container">
 		<div id="vmenus_list" class="ui-tabs-nav-side-container">
 			<div class="title"> Voice Menus </div>
+			<a href="#"><span><img src="images/add.gif" border="0" /> new</span></a>
 			<ul id="vmenus_edit_tabs" class="ui-tabs-nav-side">
-				<li><a href="#vmenu_new"><span><img src="images/add.gif" border="0" /> new</span></a></li>
-				<li><a href="#vmenu_6000"><span>test - 6000</span></a></li>
 				<li><a href="#vmenu_untitled1"><span>Untitled1</span></a></li>
 			</ul>
 		</div>
-		<div id="vmenu_new" class="ui-tabs-hide-side">
+		<div id="vmenu_template" class="ui-tabs-hide-side template">
 			<span class="save_cancel"><span class="save">Save</span><span class="cancel">Cancel</span></span>
 			<span class="extension">Extension: <input type="text" value="6000" /></span>
 			<div class="vmenu">
@@ -250,8 +249,7 @@
 				</div>
 			</div>
 		</div>
-		<div id="vmenu_6000" class="ui-tabs-hide-side"> test</div>
-		<div id="vmenu_untitled1" class="ui-tabs-hide-side"> test</div>
+		<div id="vmenu_untitled1" class="ui-tabs-hide-side"></div>
 	</div>
 </div>
 
@@ -346,6 +344,10 @@
 	);
 
 	$(document).ready( function() {
+
+		//tabs defaults
+		$('#vmenu_untitled1').html($('#vmenu_template').html());
+		selected = '#vmenu_untitled1';
 		//load the tabs
 		$("#vmenus_edit_tabs").tabs({
 			navClass: 'ui-tabs-nav-side',
@@ -355,8 +357,9 @@
 			panelClass: 'ui-tabs-panel-side',
 			hideClass: 'ui-tabs-hide-side',
 			loadingClass: 'ui-tabs-loading-side',
+			add: addVmenu,
 			select: function(e, ui) {
-				selected = ui.tab.toString().split('#')[1];
+				selected = '#'+ui.tab.toString().split('#')[1];
 			}
 		});
 
@@ -414,7 +417,7 @@
 		});
 
 		//load vmenu_template
-		vmenu_template = $('.vmenu .template');
+		vmenu_template = $('#vmenu_template > .vmenu > .template');
 	});
 
 	/* many variables only need to be pulled from html once. */




More information about the asterisk-gui-commits mailing list