Skip to content

Commit

Permalink
Merge branch 'master' into ons-dialog-element
Browse files Browse the repository at this point in the history
Conflicts:
	framework/js/onsen.js
  • Loading branch information
argelius committed Jul 21, 2015
2 parents ba96c19 + 1787418 commit 534ab4c
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 31 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -29,6 +29,8 @@ v1.3.5-dev
* ons-icon: Fixed [#688](https://github.com/OnsenUI/OnsenUI/issues/688).
* ons-page: Added page life cycle events.
* ons-list-item: Added `lock-on-drag` attribute to prevent vertical scrolling when user pans left or right.
* core: Fixed [#777](https://github.com/OnsenUI/OnsenUI/issues/777).
* core: Fixed [#767](https://github.com/OnsenUI/OnsenUI/issues/767).

v1.3.4
----
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Expand Up @@ -16,4 +16,4 @@ test:
post:
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
- find . -type f -regex "./core/test/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
- cat ./core/test/coverage/*/lcov.info | coveralls
- cat ./core/test/coverage/*/lcov.info | coveralls || true # Ignore if this fails.
5 changes: 3 additions & 2 deletions core/elements/ons-switch.es6
Expand Up @@ -58,6 +58,7 @@ limitations under the License.
} else {
this.removeAttribute('checked');
}
this._updateForCheckedAttribute();
}

get disabled() {
Expand Down Expand Up @@ -116,9 +117,9 @@ limitations under the License.

_onChangeListener() {
if (this.checked !== true) {
this.parentNode.removeAttribute('checked');
this.removeAttribute('checked');
} else {
this.parentNode.setAttribute('checked', '');
this.setAttribute('checked', '');
}
}

Expand Down
40 changes: 20 additions & 20 deletions framework/js/onsen.js
Expand Up @@ -19,15 +19,15 @@ limitations under the License.
* @ngdoc object
* @name ons
* @category util
* @description
* @description
* [ja]Onsen UIで利用できるグローバルなオブジェクトです。このオブジェクトは、AngularJSのスコープから参照することができます。 [/ja]
* [en]A global object that's used in Onsen UI. This object can be reached from the AngularJS scope.[/en]
*/

/**
* @ngdoc method
* @signature ready(callback)
* @description
* @description
* [ja]アプリの初期化に利用するメソッドです。渡された関数は、Onsen UIの初期化が終了している時点で必ず呼ばれます。[/ja]
* [en]Method used to wait for app initialization. The callback will not be executed until Onsen UI has been completely initialized.[/en]
* @param {Function} callback
Expand All @@ -38,13 +38,13 @@ limitations under the License.
/**
* @ngdoc method
* @signature bootstrap([moduleName, [dependencies]])
* @description
* @description
* [ja]Onsen UIの初期化を行います。Angular.jsのng-app属性を利用すること無しにOnsen UIを読み込んで初期化してくれます。[/ja]
* [en]Initialize Onsen UI. Can be used to load Onsen UI without using the <code>ng-app</code> attribute from AngularJS.[/en]
* @param {String} [moduleName]
* @param {String} [moduleName]
* [en]AngularJS module name.[/en]
* [ja]Angular.jsでのモジュール名[/ja]
* @param {Array} [dependencies]
* @param {Array} [dependencies]
* [en]List of AngularJS module dependencies.[/en]
* [ja]依存するAngular.jsのモジュール名の配列[/ja]
* @return {Object}
Expand All @@ -55,15 +55,15 @@ limitations under the License.
/**
* @ngdoc method
* @signature enableAutoStatusBarFill()
* @description
* @description
* [en]Enable status bar fill feature on iOS7 and above.[/en]
* [ja]iOS7以上で、ステータスバー部分の高さを自動的に埋める処理を有効にします。[/ja]
*/

/**
* @ngdoc method
* @signature disableAutoStatusBarFill()
* @description
* @description
* [en]Disable status bar fill feature on iOS7 and above.[/en]
* [ja]iOS7以上で、ステータスバー部分の高さを自動的に埋める処理を無効にします。[/ja]
*/
Expand Down Expand Up @@ -96,7 +96,7 @@ limitations under the License.
* @return {Object}
* [en]Component object. Will return null if no component was found.[/en]
* [ja]コンポーネントのオブジェクトを返します。もしコンポーネントが見つからなかった場合にはnullを返します。[/ja]
* @description
* @description
* [en]Find parent component object of <code>dom</code> element.[/en]
* [ja]指定されたdom引数の親要素をたどってコンポーネントを検索します。[/ja]
*/
Expand All @@ -113,34 +113,34 @@ limitations under the License.
* @return {Object}
* [en]Component object. Will return null if no component was found.[/en]
* [ja]コンポーネントのオブジェクトを返します。もしコンポーネントが見つからなかった場合にはnullを返します。[/ja]
* @description
* @description
* [en]Find component object using CSS selector.[/en]
* [ja]CSSセレクタを使ってコンポーネントのオブジェクトを検索します。[/ja]
*/

/**
* @ngdoc method
* @signature setDefaultDeviceBackButtonListener(listener)
* @param {Function} listener
* @param {Function} listener
* [en]Function that executes when device back button is pressed.[/en]
* [ja]デバイスのバックボタンが押された時に実行される関数オブジェクトを指定します。[/ja]
* @description
* @description
* [en]Set default handler for device back button.[/en]
* [ja]デバイスのバックボタンのためのデフォルトのハンドラを設定します。[/ja]
*/

/**
* @ngdoc method
* @signature disableDeviceBackButtonHandler()
* @description
* @description
* [en]Disable device back button event handler.[/en]
* [ja]デバイスのバックボタンのイベントを受け付けないようにします。[/ja]
*/

/**
* @ngdoc method
* @signature enableDeviceBackButtonHandler()
* @description
* @description
* [en]Enable device back button event handler.[/en]
* [ja]デバイスのバックボタンのイベントを受け付けるようにします。[/ja]
*/
Expand All @@ -151,7 +151,7 @@ limitations under the License.
* @return {Boolean}
* [en]Will be true if Onsen UI is initialized.[/en]
* [ja]初期化されているかどうかを返します。[/ja]
* @description
* @description
* [en]Returns true if Onsen UI is initialized.[/en]
* [ja]Onsen UIがすでに初期化されているかどうかを返すメソッドです。[/ja]
*/
Expand All @@ -162,7 +162,7 @@ limitations under the License.
* @param {HTMLElement} dom
* [en]Element to compile.[/en]
* [ja]コンパイルする要素を指定します。[/ja]
* @description
* @description
* [en]Compile Onsen UI components.[/en]
* [ja]通常のHTMLの要素をOnsen UIのコンポーネントにコンパイルします。[/ja]
*/
Expand All @@ -173,7 +173,7 @@ limitations under the License.
* @return {Boolean}
* [en]Will be true if the app is running in Cordova.[/en]
* [ja]Cordovaで実行されている場合にtrueになります。[/ja]
* @description
* @description
* [en]Returns true if running inside Cordova.[/en]
* [ja]Cordovaで実行されているかどうかを返すメソッドです。[/ja]
*/
Expand All @@ -193,7 +193,7 @@ limitations under the License.
* @return {Promise}
* [en]Promise object that resolves to the alert dialog component object.[/en]
* [ja]ダイアログのコンポーネントオブジェクトを解決するPromiseオブジェクトを返します。[/ja]
* @description
* @description
* [en]Create a alert dialog instance from a template.[/en]
* [ja]テンプレートからアラートダイアログのインスタンスを生成します。[/ja]
*/
Expand All @@ -213,7 +213,7 @@ limitations under the License.
* @return {Promise}
* [en]Promise object that resolves to the dialog component object.[/en]
* [ja]ダイアログのコンポーネントオブジェクトを解決するPromiseオブジェクトを返します。[/ja]
* @description
* @description
* [en]Create a dialog instance from a template.[/en]
* [ja]テンプレートからダイアログのインスタンスを生成します。[/ja]
*/
Expand All @@ -233,7 +233,7 @@ limitations under the License.
* @return {Promise}
* [en]Promise object that resolves to the popover component object.[/en]
* [ja]ポップオーバーのコンポーネントオブジェクトを解決するPromiseオブジェクトを返します。[/ja]
* @description
* @description
* [en]Create a popover instance from a template.[/en]
* [ja]テンプレートからポップオーバーのインスタンスを生成します。[/ja]
*/
Expand Down Expand Up @@ -327,7 +327,7 @@ limitations under the License.
var module = angular.module(name, deps);

var doc = window.document;
if (doc.readyState == 'loading' || doc.readyState == 'uninitialized') {
if (doc.readyState == 'loading' || doc.readyState == 'uninitialized' || doc.readyState == 'interactive') {
doc.addEventListener('DOMContentLoaded', function() {
angular.bootstrap(doc.documentElement, [name]);
}, false);
Expand Down
20 changes: 12 additions & 8 deletions framework/services/onsen.js
Expand Up @@ -62,7 +62,7 @@ limitations under the License.
return element[methodName].apply(element, arguments);
};
});

return function() {
methodNames.forEach(function(methodName) {
view[methodName] = null;
Expand Down Expand Up @@ -163,7 +163,7 @@ limitations under the License.
deferred.resolve(this.normalizePageHTML(html));

return deferred.promise;

} else {
return $http({
url: page,
Expand All @@ -186,7 +186,7 @@ limitations under the License.
if (!html.match(/^<(ons-page|ons-navigator|ons-tabbar|ons-sliding-menu|ons-split-view)/)) {
html = '<ons-page>' + html + '</ons-page>';
}

return html;
},

Expand All @@ -195,7 +195,7 @@ limitations under the License.
*
* @param {Object} attrs
* @param {Array} [modifiers] an array of appendix modifier
* @return {Function}
* @return {Function}
*/
generateModifierTemplater: function(attrs, modifiers) {
var attrModifiers = attrs && typeof attrs.modifier === 'string' ? attrs.modifier.trim().split(/ +/) : [];
Expand All @@ -216,7 +216,7 @@ limitations under the License.
* Add modifier methods to view object for custom elements.
*
* @param {Object} view object
* @param {jqLite} element
* @param {jqLite} element
*/
addModifierMethodsForCustomElements: function(view, element) {
var methods = {
Expand Down Expand Up @@ -268,7 +268,7 @@ limitations under the License.
*
* @param {Object} view object
* @param {String} template
* @param {jqLite} element
* @param {jqLite} element
*/
addModifierMethods: function(view, template, element) {
var _tr = function(modifier) {
Expand All @@ -285,7 +285,7 @@ limitations under the License.
},

addModifier: function(modifier) {
element.addClass(_tr(modifier));
element.addClass(_tr(modifier));
},

setModifier: function(modifier) {
Expand All @@ -306,7 +306,7 @@ limitations under the License.
toggleModifier: function(modifier) {
var cls = _tr(modifier);
if (element.hasClass(cls)) {
element.removeClass(cls);
element.removeClass(cls);
} else {
element.addClass(cls);
}
Expand Down Expand Up @@ -469,6 +469,10 @@ limitations under the License.
}

container[names[names.length - 1]] = object;

if (container[names[names.length -1]] !== object) {
throw new Error('Cannot set var="' + object._attrs.var + '" because it will overwrite a read-only variable.');
}
}

if (ons.componentBase) {
Expand Down

0 comments on commit 534ab4c

Please sign in to comment.