From: Salvatore Iovene Date: Mon, 29 Jul 2013 09:14:41 +0000 (+0300) Subject: Move page registration code from widget to core. X-Git-Tag: 0.1.4~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7123f18351d94c3444a1107db2a013662cf1f04c;p=profile%2Fivi%2Fcowhide.git Move page registration code from widget to core. --- diff --git a/dist/cowhide.js b/dist/cowhide.js index b8ff9a1..8492ea8 100644 --- a/dist/cowhide.js +++ b/dist/cowhide.js @@ -32422,6 +32422,16 @@ $.widget( "ui.tooltip", { if (_.indexOf(guids, widget.guid) == -1) { self.registeredWidgets.push(widget); } + + /* TODO: core should ask `page` what a page looks like. */ + if(!(widget.$element[0].tagName == 'DIV' && widget.$element.hasClass('page'))) { + var $page = widget.$element.parent().closest('div.page'); + if ($page.length === 0) { + $.cowhide.fatal("#30: every widget must be within a div with class='page'.", this.$element); + } else { + $page.ch_page('register', widget); + } + } }, // TODO: use `backdrop` from Bootstrap's modal @@ -32581,15 +32591,6 @@ $.widget( "ui.tooltip", { this.$element = $(element); this.options = $.extend({}, $.fn.ch_widget.defaults); this.drivingMode = false; - - if(!(this.$element[0].tagName == 'DIV' && this.$element.hasClass('page'))) { - var $page = this.$element.parent().closest('div.page'); - if ($page.length === 0) { - $.cowhide.fatal("#30: every widget must be within a div with class='page'.", this.$element); - } else { - $page.ch_page('register', this); - } - } }; ChWidget.prototype = $.extend({}, { diff --git a/dist/cowhide.min.js b/dist/cowhide.min.js index c9f85d2..43e0772 100644 --- a/dist/cowhide.min.js +++ b/dist/cowhide.min.js @@ -9,4 +9,4 @@ return t}),gt:d(function(t,e,i){for(var n=0>i?i+e:i;e>++n;)t.push(n);return t})} }})}}(jQuery),function(t){t.effects.effect.transfer=function(e,i){var n=t(this),s=t(e.to),o="fixed"===s.css("position"),r=t("body"),a=o?r.scrollTop():0,l=o?r.scrollLeft():0,h=s.offset(),c={top:h.top-a,left:h.left-l,height:s.innerHeight(),width:s.innerWidth()},u=n.offset(),d=t("
").appendTo(document.body).addClass(e.className).css({top:u.top-a,left:u.left-l,height:n.innerHeight(),width:n.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}}(jQuery),function(t){t.widget("ui.menu",{version:"@VERSION",defaultElement:"