From 050e1c0eca863c23f2e6d1bc21b568b5fdd26b11 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 25 Aug 2011 16:39:09 +0200 Subject: [PATCH 1/9] fixed grid offset when re-ordering --- data/grid/grid.js | 4 ++-- data/order/order.js | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/data/grid/grid.js b/data/grid/grid.js index 3c64fae..9ece70a 100644 --- a/data/grid/grid.js +++ b/data/grid/grid.js @@ -112,8 +112,8 @@ $.Controller.extend("Mxui.Data.Grid",{ if(attr !== 'count' && attr !== 'updating'){ //want to throttle for rapid updates params.attr('updating', true) - clearTimeout(this.newRequestTimer,100) - this.newRequestTimer = setTimeout(this.callback('newRequest', attr, val)) + clearTimeout(this.newRequestTimer) + this.newRequestTimer = setTimeout(this.callback('newRequest', attr, val), 100) } }, newRequest : function(attr, val){ diff --git a/data/order/order.js b/data/order/order.js index b03af6c..74e0e1d 100644 --- a/data/order/order.js +++ b/data/order/order.js @@ -79,9 +79,8 @@ $.Controller('Mxui.Data.Order', order.unshift(newOrder) } } - this.options.params.attrs({ - 'order' : order, - offset: 0}) + this.options.params.attr('offset', 0) + this.options.params.attr('order', order) } }) From e93c434017bec6ef3b24a4648e3f77182dfd3f95 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 19 Sep 2011 22:05:19 +0200 Subject: [PATCH 2/9] commented model delegation, handle this stuff in application controllers --- data/grid/grid.js | 62 ++++++++++++++++++++-------------------- data/grid/views/init.ejs | 1 - data/grid/views/list.ejs | 2 +- 3 files changed, 32 insertions(+), 33 deletions(-) diff --git a/data/grid/grid.js b/data/grid/grid.js index d208edf..e6b5324 100644 --- a/data/grid/grid.js +++ b/data/grid/grid.js @@ -116,7 +116,7 @@ $.Controller.extend("Mxui.Data.Grid",{ if(clear){ this.empty(); } - + this.append(trs); // update the items this.options.params.attr('count',items.count) @@ -130,7 +130,7 @@ $.Controller.extend("Mxui.Data.Grid",{ } }, newRequest : function(attr, val){ - var clear = true; + var clear = true; if(!this.options.offsetEmpties && attr == "offset"){ // if offset changes and we have offsetEmpties false clear = false; } @@ -141,35 +141,35 @@ $.Controller.extend("Mxui.Data.Grid",{ * @param {Object} called * @param {Object} item */ - "{model} updated" : function(model, ev, item){ - var el = item.elements(this.element).html(this.options.row, item); - if(this.options.updated){ - this.options.updated(this.element, el, item) - } - this.element.resize() - }, - "{model} created" : function(model, ev, item){ - var newEl = $($.View("//mxui/data/grid/views/list",{ - items : [item], - row: this.options.row - })) - if(this.options.append){ - this.options.append(this.element, newEl, item) - }else{ - this.append(newEl) - //newEl.appendTo(this.element).slideDown(); - } - }, - "{model} destroyed" : function(model, ev, item){ - var el = item.elements(this.element) - if(this.options.remove){ - this.options.remove(this.element,el, item) - }else{ - el.slideUp( function(){ - el.remove(); - }) - } - }, +// "{model} updated" : function(model, ev, item){ +// var el = item.elements(this.element).html(this.options.row, item); +// if(this.options.updated){ +// this.options.updated(this.element, el, item) +// } +// this.element.resize() +// }, +// "{model} created" : function(model, ev, item){ +// var newEl = $($.View("//mxui/data/grid/views/list",{ +// items : [item], +// row: this.options.row +// })) +// if(this.options.append){ +// this.options.append(this.element, newEl, item) +// }else{ +// this.append(newEl) +// //newEl.appendTo(this.element).slideDown(); +// } +// }, +// "{model} destroyed" : function(model, ev, item){ +// var el = item.elements(this.element) +// if(this.options.remove){ +// this.options.remove(this.element,el, item) +// }else{ +// el.slideUp( function(){ +// el.remove(); +// }) +// } +// }, /** * Insert rows into the table * @param {Object} row insert after this row diff --git a/data/grid/views/init.ejs b/data/grid/views/init.ejs index ae0ca07..c97bcb5 100644 --- a/data/grid/views/init.ejs +++ b/data/grid/views/init.ejs @@ -12,5 +12,4 @@ - \ No newline at end of file diff --git a/data/grid/views/list.ejs b/data/grid/views/list.ejs index 9f8cee6..82ba3b4 100644 --- a/data/grid/views/list.ejs +++ b/data/grid/views/list.ejs @@ -2,4 +2,4 @@ tabindex='0'> <%== $.View(row, items[i] ) %> -<%}%> \ No newline at end of file +<% } %> \ No newline at end of file From 9a2cb4a7e096d99dec698004e93791f6ec454e8b Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 20 Sep 2011 07:10:10 +0200 Subject: [PATCH 3/9] added prepend action to grid and tablescroll --- data/grid/grid.js | 3 +++ layout/table_scroll/table_scroll.js | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/data/grid/grid.js b/data/grid/grid.js index e6b5324..9f07bb1 100644 --- a/data/grid/grid.js +++ b/data/grid/grid.js @@ -178,6 +178,9 @@ $.Controller.extend("Mxui.Data.Grid",{ append: function( row, newEls ) { this.element.children(":first").mxui_layout_table_scroll("append", row, newEls) }, + prepend: function(row, newEls){ + this.element.children(":first").mxui_layout_table_scroll("prepend", row, newEls) + }, // remove all content from the grid empty: function(){ this.element.children(":first").mxui_layout_table_scroll("empty") diff --git a/layout/table_scroll/table_scroll.js b/layout/table_scroll/table_scroll.js index a787c05..587d3b6 100644 --- a/layout/table_scroll/table_scroll.js +++ b/layout/table_scroll/table_scroll.js @@ -180,13 +180,21 @@ $.Controller("Mxui.Layout.TableScroll",{ if(!this.$.spacer){ this.changed(false); } - + this.$.spacer && this.$.spacer.before(after) } else{ after.after(els) } this.element.resize(); }, + prepend: function(before, els){ + if(!els){ + this.$.tbody && this.$.tbody.prepend(before) + } else{ + before.before(els) + } + this.element.resize(); + }, empty : function(){ this.$.tbody.children(":not(.spacing)").remove(); this.element.resize(); From e9d24359ac53ebb6417209a30293f30e432e1361 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 20 Sep 2011 11:54:49 +0200 Subject: [PATCH 4/9] added stome stuff to grid --- data/grid/grid.js | 61 ++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/data/grid/grid.js b/data/grid/grid.js index 9f07bb1..f56c0c8 100644 --- a/data/grid/grid.js +++ b/data/grid/grid.js @@ -4,7 +4,9 @@ steal('mxui/layout/table_scroll', 'jquery/view/ejs', 'mxui/data/order', 'mxui/util/selectable') - .then('./views/th.ejs','./views/init.ejs','./views/list.ejs') + .then('jquery-ui/ui/jquery.effects.core.js') + .then('jquery-ui/ui/jquery.effects.slide.js') +// .then('./views/th.ejs','./views/init.ejs','./views/list.ejs') .then(function($){ /** * A simple data grid that is paginate-able and sortable. @@ -141,35 +143,34 @@ $.Controller.extend("Mxui.Data.Grid",{ * @param {Object} called * @param {Object} item */ -// "{model} updated" : function(model, ev, item){ -// var el = item.elements(this.element).html(this.options.row, item); -// if(this.options.updated){ -// this.options.updated(this.element, el, item) -// } -// this.element.resize() -// }, -// "{model} created" : function(model, ev, item){ -// var newEl = $($.View("//mxui/data/grid/views/list",{ -// items : [item], -// row: this.options.row -// })) -// if(this.options.append){ -// this.options.append(this.element, newEl, item) -// }else{ -// this.append(newEl) -// //newEl.appendTo(this.element).slideDown(); -// } -// }, -// "{model} destroyed" : function(model, ev, item){ -// var el = item.elements(this.element) -// if(this.options.remove){ -// this.options.remove(this.element,el, item) -// }else{ -// el.slideUp( function(){ -// el.remove(); -// }) -// } -// }, + "{model} updated" : function(model, ev, item){ + var el = item.elements(this.element).html(this.options.row, item); + if(this.options.updated){ + this.options.updated(this.element, el, item) + } + this.element.resize() + }, + "{model} created" : function(model, ev, item){ + var newEl = $($.View("//mxui/data/grid/views/list",{ + items : [item], + row: this.options.row + })) + if(this.options.append){ + this.options.append(this.element, newEl, item) + }else{ + this.prepend(newEl) + //newEl.appendTo(this.element).slideDown(); + } + }, + "{model} destroyed" : function(model, ev, item){ + var el = item.elements(this.element) + if(this.options.remove){ + this.options.remove(this.element,el, item) + }else{ + el.remove() + + } + }, /** * Insert rows into the table * @param {Object} row insert after this row From dc03900506414d3e2ab0cd0b0b729baa97982495 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 20 Sep 2011 20:42:53 +0200 Subject: [PATCH 5/9] rewrite grid to store template in options and factor dom manipulation form on event --- data/grid/grid.js | 65 ++++++++++++++++++++++++---------------- data/grid/views/init.ejs | 2 +- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/data/grid/grid.js b/data/grid/grid.js index f56c0c8..86fdce9 100644 --- a/data/grid/grid.js +++ b/data/grid/grid.js @@ -40,7 +40,10 @@ $.Controller.extend("Mxui.Data.Grid",{ defaults: { columns: {}, params: new Mxui.Data, - row : null, + initTemplate: '//mxui/data/grid/views/init.ejs', + listTemplate: '//mxui/data/grid/views/list.ejs', + titleTemplate: '//mxui/data/grid/views/th.ejs', + rowTemplate : null, model : null, noItems : "No Items", // if true, can sort by multiple columns at a time @@ -54,7 +57,23 @@ $.Controller.extend("Mxui.Data.Grid",{ // immediately uses the model to request items for the grid loadImmediate: true, - selectable : true + selectable : true, + + // default crud manipulations + + refresh: function(tbody, elt, newElt){ + elt.replaceWith(newElt) + tbody.resize() + }, + append: function(tbody, newElt){ + tbody.prepend(newElt) + tbody.resize() + }, + remove: function(tbody, elt){ + elt.remove() + tbody.resize() + } + }, listensTo : ["select","deselect"] }, @@ -65,7 +84,7 @@ $.Controller.extend("Mxui.Data.Grid",{ for(var name in this.options.columns){ count++; } - this.element.append( this.view({columns: this.options.columns, count: count}) ) + this.element.append( this.view(this.options.initTemplate,{titleTemplate: this.options.titleTemplate, columns: this.options.columns, count: count}) ) this.element.children('table').mxui_layout_table_scroll({ filler: this.options.filler @@ -110,8 +129,8 @@ $.Controller.extend("Mxui.Data.Grid",{ this.options.params.attr('updating', false); - var trs = $(this.view('list',{ - row : this.options.row, + var trs = $(this.view(this.options.listTemplate,{ + rowTemplate : this.options.rowTemplate, items: items })); @@ -138,38 +157,31 @@ $.Controller.extend("Mxui.Data.Grid",{ } this.options.model.findAll(this.options.params.attrs(), this.callback('list', clear)) }, + _getRows: function(viewTemplateOption, items){ + items = ( $.isArray(items) || items instanceof $.Model.List ) ? items : [items] + return $(this.view(this.options.listTemplate,{ + rowTemplate : this.options[viewTemplateOption], + items: items + }, { columns: this.options.columns, renderer: this.options.renderer } )); + }, + /** * Listen for updates and replace the text of the list * @param {Object} called * @param {Object} item */ "{model} updated" : function(model, ev, item){ - var el = item.elements(this.element).html(this.options.row, item); - if(this.options.updated){ - this.options.updated(this.element, el, item) - } - this.element.resize() + var el = item.elements(this.element), + newElt= this._getRows('rowTemplate', item) + this.options.refresh(this.$.tbody, el, newElt) }, "{model} created" : function(model, ev, item){ - var newEl = $($.View("//mxui/data/grid/views/list",{ - items : [item], - row: this.options.row - })) - if(this.options.append){ - this.options.append(this.element, newEl, item) - }else{ - this.prepend(newEl) - //newEl.appendTo(this.element).slideDown(); - } + var newEl = this._getRows('rowTemplate', item) + this.options.append(this.$.tbody, newEl) }, "{model} destroyed" : function(model, ev, item){ var el = item.elements(this.element) - if(this.options.remove){ - this.options.remove(this.element,el, item) - }else{ - el.remove() - - } + this.options.remove(this.$.tbody, el) }, /** * Insert rows into the table @@ -186,6 +198,7 @@ $.Controller.extend("Mxui.Data.Grid",{ empty: function(){ this.element.children(":first").mxui_layout_table_scroll("empty") }, + "select" : function(el, ev){ ev.preventDefault(); }, diff --git a/data/grid/views/init.ejs b/data/grid/views/init.ejs index c97bcb5..3d23d3e 100644 --- a/data/grid/views/init.ejs +++ b/data/grid/views/init.ejs @@ -2,7 +2,7 @@ <%for(var col in columns){%> - <%== view('//mxui/data/grid/views/th', {name: col, title: columns[col]}) %> + <%== $.View('//mxui/data/grid/views/th', {name: col, title: columns[col]}) %> <%}%> From e05858531c7cdc690f58282a040d882562b28153 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Wed, 21 Sep 2011 15:54:33 +0200 Subject: [PATCH 6/9] use String.getObject insteand of Object --- data/grid2/scripts/standalone/modelfixture.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/grid2/scripts/standalone/modelfixture.js b/data/grid2/scripts/standalone/modelfixture.js index b4cc062..d327302 100644 --- a/data/grid2/scripts/standalone/modelfixture.js +++ b/data/grid2/scripts/standalone/modelfixture.js @@ -505,7 +505,7 @@ var parts = fullName.split(/\./), shortName = parts.pop(), - current = $.Class.getObject(parts.join('.')), + current = $.String.getObject(parts.join('.')), namespace = current; From bdac01cb821c221d4134cf71494d25f40859d82b Mon Sep 17 00:00:00 2001 From: Nicolas Date: Wed, 5 Oct 2011 21:53:34 +0200 Subject: [PATCH 7/9] failing filler demo --- layout/fill/fill4.html | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 layout/fill/fill4.html diff --git a/layout/fill/fill4.html b/layout/fill/fill4.html new file mode 100644 index 0000000..08098a2 --- /dev/null +++ b/layout/fill/fill4.html @@ -0,0 +1,42 @@ + + + + fill 4 + + + + + + +
+
this element height lacks 2em
+
+ + + + \ No newline at end of file From 48119146a8b3c83a8ce4c23d5e43056565fa486f Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 6 Oct 2011 10:02:48 +0200 Subject: [PATCH 8/9] stuff --- data/grid/grid.js | 19 +++++---- data/grid/views/init.ejs | 5 +-- form/combobox/combobox.html | 2 +- form/combobox/combobox.js | 3 +- form/combobox/funcunit.html | 7 +++- form/combobox/select/select.js | 2 +- .../combobox/select/test/funcunit/funcunit.js | 5 +-- form/combobox/test/funcunit/funcunit.js | 41 +++++++++---------- .../test/funcunit/positioning4a_tests.js | 2 +- layout/fill/fill.js | 9 +++- layout/fit/fit.html | 10 ++--- layout/modal/modal.html | 10 +++-- layout/modal/modal.js | 4 +- layout/positionable/positionable.html | 6 +-- nav/menu/menu.js | 2 +- 15 files changed, 70 insertions(+), 57 deletions(-) diff --git a/data/grid/grid.js b/data/grid/grid.js index 86fdce9..613cdd7 100644 --- a/data/grid/grid.js +++ b/data/grid/grid.js @@ -155,8 +155,11 @@ $.Controller.extend("Mxui.Data.Grid",{ if(!this.options.offsetEmpties && attr == "offset"){ // if offset changes and we have offsetEmpties false clear = false; } - this.options.model.findAll(this.options.params.attrs(), this.callback('list', clear)) + this.makeRequest(clear) }, + makeRequest: function(clear){ + this.options.model.findAll(this.options.params.attrs(), this.callback('list', clear)) + }, _getRows: function(viewTemplateOption, items){ items = ( $.isArray(items) || items instanceof $.Model.List ) ? items : [items] return $(this.view(this.options.listTemplate,{ @@ -171,9 +174,11 @@ $.Controller.extend("Mxui.Data.Grid",{ * @param {Object} item */ "{model} updated" : function(model, ev, item){ - var el = item.elements(this.element), - newElt= this._getRows('rowTemplate', item) - this.options.refresh(this.$.tbody, el, newElt) + var el = item.elements(this.element) + if (el.length > 0){ + var newElt= this._getRows('rowTemplate', item) + this.options.refresh(this.$.tbody, el, newElt) + } }, "{model} created" : function(model, ev, item){ var newEl = this._getRows('rowTemplate', item) @@ -189,14 +194,14 @@ $.Controller.extend("Mxui.Data.Grid",{ * @param {Object} newEls new elements to insert (they should be trs) */ append: function( row, newEls ) { - this.element.children(":first").mxui_layout_table_scroll("append", row, newEls) + this.element.children(".mxui_layout_table_scroll").mxui_layout_table_scroll("append", row, newEls) }, prepend: function(row, newEls){ - this.element.children(":first").mxui_layout_table_scroll("prepend", row, newEls) + this.element.children(".mxui_layout_table_scroll").mxui_layout_table_scroll("prepend", row, newEls) }, // remove all content from the grid empty: function(){ - this.element.children(":first").mxui_layout_table_scroll("empty") + this.element.children(".mxui_layout_table_scroll").mxui_layout_table_scroll("empty") }, "select" : function(el, ev){ diff --git a/data/grid/views/init.ejs b/data/grid/views/init.ejs index 3d23d3e..70d3bc3 100644 --- a/data/grid/views/init.ejs +++ b/data/grid/views/init.ejs @@ -7,9 +7,6 @@ - - Loading ... - - + \ No newline at end of file diff --git a/form/combobox/combobox.html b/form/combobox/combobox.html index 71e5655..33ced71 100644 --- a/form/combobox/combobox.html +++ b/form/combobox/combobox.html @@ -466,7 +466,7 @@

No Selection

- steal.start(); + diff --git a/form/combobox/combobox.js b/form/combobox/combobox.js index 6a0e0da..604834a 100644 --- a/form/combobox/combobox.js +++ b/form/combobox/combobox.js @@ -1,5 +1,6 @@ steal('jquery/controller', 'jquery/lang/json', 'mxui/util/scrollbar_width', 'jquery/event/key') - .controllers('dropdown','selectable').then(function() { + .then('./controllers/dropdown_controller.js','./controllers/selectable_controller.js') + .then(function() { /** * @tag home diff --git a/form/combobox/funcunit.html b/form/combobox/funcunit.html index c4360e7..460519e 100644 --- a/form/combobox/funcunit.html +++ b/form/combobox/funcunit.html @@ -1,13 +1,13 @@ - + FuncUnit Test - + @@ -17,4 +17,7 @@

    + \ No newline at end of file diff --git a/form/combobox/select/select.js b/form/combobox/select/select.js index 5257b25..47742ef 100644 --- a/form/combobox/select/select.js +++ b/form/combobox/select/select.js @@ -13,7 +13,7 @@ steal('mxui/form/combobox').then(function(){ var input = $("") .attr("id", id) .attr("name", name) - .attr("className", className) + .addClass(className) var items = [], option, $option; el.find("option").each(function(){ diff --git a/form/combobox/select/test/funcunit/funcunit.js b/form/combobox/select/test/funcunit/funcunit.js index 5ac5d82..3eb786b 100644 --- a/form/combobox/select/test/funcunit/funcunit.js +++ b/form/combobox/select/test/funcunit/funcunit.js @@ -1,3 +1,2 @@ -steal - .plugins("funcunit") - .then("select_test") \ No newline at end of file +steal("funcunit") + .then("mxui/form/combobox/test/select_test") \ No newline at end of file diff --git a/form/combobox/test/funcunit/funcunit.js b/form/combobox/test/funcunit/funcunit.js index 797738b..0faf848 100644 --- a/form/combobox/test/funcunit/funcunit.js +++ b/form/combobox/test/funcunit/funcunit.js @@ -1,21 +1,20 @@ -steal - .plugins("funcunit") - .then("smoke_tests", - "positioning4a_tests", - "positioning4b_tests", - "positioning4c_tests", - "positioning4d_tests", - "positioning4e_tests", - "positioning5a_tests", - "positioning5b_tests", - "positioning5c_tests", - "positioning5d_tests", - "positioning5e_tests", - "positioning6a_tests", - "positioning6b_tests", - "positioning6c_tests", - "positioning6d_tests", - "positioning6e_tests", - "autocomplete7_tests", - "api8a_tests", - "api8b_tests") \ No newline at end of file +steal("funcunit") + .then("./smoke_tests", + "./positioning4a_tests", + "./positioning4b_tests", + "./positioning4c_tests", + "./positioning4d_tests", + "./positioning4e_tests", + "./positioning5a_tests", + "./positioning5b_tests", + "./positioning5c_tests", + "./positioning5d_tests", + "./positioning5e_tests", + "./positioning6a_tests", + "./positioning6b_tests", + "./positioning6c_tests", + "./positioning6d_tests", + "./positioning6e_tests", + "./autocomplete7_tests", + "./api8a_tests", + "./api8b_tests") \ No newline at end of file diff --git a/form/combobox/test/funcunit/positioning4a_tests.js b/form/combobox/test/funcunit/positioning4a_tests.js index 92b1246..8f0c4ad 100644 --- a/form/combobox/test/funcunit/positioning4a_tests.js +++ b/form/combobox/test/funcunit/positioning4a_tests.js @@ -1,6 +1,6 @@ module("combobox4 test", { setup: function(){ - S.open("//mxui/combobox/positioning4a.html"); + S.open("//mxui/form/combobox/positioning4a.html"); } }) diff --git a/layout/fill/fill.js b/layout/fill/fill.js index f38c3fd..3e0c131 100644 --- a/layout/fill/fill.js +++ b/layout/fill/fill.js @@ -54,7 +54,8 @@ steal('jquery/dom/dimensions', 'jquery/event/resize').then(function( $ ) { inFloat: inFloat(this[0], thePage ? document.body : options.parent[0]), options: options }; - $(options.parent).bind('resize', evData, filler.parentResize); + + $(options.parent).bind('resize', evData, filler.parentResize) //if this element is removed, take it out this.bind('destroyed', evData, function( ev ) { @@ -81,10 +82,16 @@ steal('jquery/dom/dimensions', 'jquery/event/resize').then(function( $ ) { $.extend(filler, { parentResize: function( ev ) { + if (ev.data.filler.is(':hidden')){ + //ev.stopPropagation() + return + } + var parent = $(this), isWindow = this == window, container = (isWindow ? $(document.body) : parent), + //if the parent bleeds margins, we don't care what the last element's margin is isBleeder = bleeder(parent), children = container.children().filter(function() { diff --git a/layout/fit/fit.html b/layout/fit/fit.html index 93ab513..e0606e5 100644 --- a/layout/fit/fit.html +++ b/layout/fit/fit.html @@ -42,7 +42,7 @@ left: 300px; } - +
    Demo Fittable
    @@ -93,7 +93,7 @@ // .css("position", "absolute") .html( items(5)); $("#target1").click(function(ev){ - $("#fittable1").fit({ + $("#fittable1").mxui_layout_fit({ within:300, of:$("#target1") }).css("opacity",1); @@ -102,7 +102,7 @@ $("#fittable2")//.css("opacity",0) .html( items(30)); $("#target2").click(function(ev){ - $("#fittable2").fit({ + $("#fittable2").mxui_layout_fit({ within:300, of:$("#target2") }) @@ -110,7 +110,7 @@ $("#fittable3").html( items(30)); $("#target3").click(function(ev){ - $("#fittable3").fit({ + $("#fittable3").mxui_layout_fit({ within:300, of:$("#target3") }); @@ -118,7 +118,7 @@ $("#fittable4").html( items(20)); $("#target4").click(function(ev){ - $("#fittable4").fit({ + $("#fittable4").mxui_layout_fit({ within:300, of:$("#target4") }); diff --git a/layout/modal/modal.html b/layout/modal/modal.html index 8c34fc7..b6b8cbe 100644 --- a/layout/modal/modal.html +++ b/layout/modal/modal.html @@ -26,12 +26,14 @@

    Some Modal

    show as modal \ No newline at end of file diff --git a/layout/modal/modal.js b/layout/modal/modal.js index abf82f0..f7924c0 100644 --- a/layout/modal/modal.js +++ b/layout/modal/modal.js @@ -1,5 +1,5 @@ -steal('jquery/controller','mxui/positionable').then(function($){ - Mxui.Positionable("Mxui.Modal", { +steal('jquery/controller','mxui/layout/positionable').then(function($){ + Mxui.Layout.Positionable("Mxui.Modal", { defaults: { my: 'center center', at: 'center center', diff --git a/layout/positionable/positionable.html b/layout/positionable/positionable.html index 565c388..5d5b5d4 100644 --- a/layout/positionable/positionable.html +++ b/layout/positionable/positionable.html @@ -125,19 +125,19 @@

    Positionable

    \ No newline at end of file diff --git a/nav/menu/menu.js b/nav/menu/menu.js index 616a84f..52d940b 100644 --- a/nav/menu/menu.js +++ b/nav/menu/menu.js @@ -111,7 +111,9 @@ steal('mxui/layout/positionable','mxui/nav/menuable','jquery/event/hover').then( ">show" : function(el, ev){ if(ev.target == this.element[0]){ this.element.show(); - } + // prevent the event to trigger the positionable "show" handler + ev.stopPropagation() + } } }); @@ -145,14 +147,14 @@ steal('mxui/layout/positionable','mxui/nav/menuable','jquery/event/hover').then( */ Mxui.Nav.Menu.extend("Mxui.UI.Menu",{ defaults: { - types : [Mxui.Layout.Positionable("Mxui.UI.TopLeft",{defaults: {my: "left top",at: "right top"}},{}), + types : [Mxui.Layout.Positionable("Mxui.UI.TopLeft",{defaults: {my: "left top",at: "right top", keep:true}},{}), Mxui.UI.Highlight], select_event : "hoverenter", child_selector : "li", class_names : "ui-widget-content ui-menu ui-widget ui-corner-all", child_class_names : "ui-menu-item ui-state-default", apply_types_to_top : true, - // active : "ui-state-active" + active : "ui-state-active" } },{}) diff --git a/nav/menuable/menuable.js b/nav/menuable/menuable.js index e07616b..d0e594a 100644 --- a/nav/menuable/menuable.js +++ b/nav/menuable/menuable.js @@ -59,7 +59,7 @@ steal('jquery/controller', if(this.activating) return; this.activating = true; - var options = this.options, oldActive = this.find("."+options.active+":first"), self= this; + var options = this.options, oldActive = this.element.children("."+options.active+":first"), self= this; ev.pause(); var doThis = function(){