mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fixed xml-declaration tests.
This commit is contained in:
@@ -192,7 +192,7 @@ export class Binding {
|
||||
|
||||
public loadedHandlerVisualTreeBinding(args) {
|
||||
let target = args.object;
|
||||
target.off(ViewBase.loadedEvent, this.loadedHandlerVisualTreeBinding, this);
|
||||
target.off("loaded", this.loadedHandlerVisualTreeBinding, this);
|
||||
if (!types.isNullOrUndefined(target.bindingContext)) {
|
||||
this.bind(target.bindingContext);
|
||||
}
|
||||
@@ -288,8 +288,8 @@ export class Binding {
|
||||
currentObject = parentView.bindingContext;
|
||||
} else {
|
||||
let targetInstance = this.target.get();
|
||||
targetInstance.off(ViewBase.loadedEvent, this.loadedHandlerVisualTreeBinding, this);
|
||||
targetInstance.on(ViewBase.loadedEvent, this.loadedHandlerVisualTreeBinding, this);
|
||||
targetInstance.off("loaded", this.loadedHandlerVisualTreeBinding, this);
|
||||
targetInstance.on("loaded", this.loadedHandlerVisualTreeBinding, this);
|
||||
}
|
||||
|
||||
currentObjectChanged = true;
|
||||
|
||||
@@ -362,7 +362,6 @@ export class InheritedProperty<T extends ViewBase, U> extends Property<T, U> imp
|
||||
if (currentValue !== newValue) {
|
||||
|
||||
if (this.hasListeners(eventName)) {
|
||||
console.log("Notify " + eventName);
|
||||
this.notify({
|
||||
eventName: eventName,
|
||||
propertyName: name,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { GestureEventData, SwipeGestureEventData, PanGestureEventData, RotationGestureEventData, PinchGestureEventData } from "ui/gestures";
|
||||
import { GesturesObserverBase, toString, TouchAction, GestureStateTypes, GestureTypes, SwipeDirection, View, EventData } from "./gestures-common";
|
||||
import { GesturesObserverBase, toString, TouchAction, GestureStateTypes, GestureTypes, SwipeDirection, View, EventData } from "./gestures-common";
|
||||
import { ios } from "utils/utils";
|
||||
import getter = ios.getter;
|
||||
|
||||
@@ -92,8 +92,8 @@ export class GesturesObserver extends GesturesObserverBase {
|
||||
this._detach();
|
||||
};
|
||||
|
||||
this.target.on(View.loadedEvent, this._onTargetLoaded);
|
||||
this.target.on(View.unloadedEvent, this._onTargetUnloaded);
|
||||
this.target.on("loaded", this._onTargetLoaded);
|
||||
this.target.on("unloaded", this._onTargetUnloaded);
|
||||
|
||||
if (this.target.isLoaded) {
|
||||
this._attach(this.target, type);
|
||||
@@ -183,8 +183,8 @@ export class GesturesObserver extends GesturesObserverBase {
|
||||
this._detach();
|
||||
|
||||
if (this.target) {
|
||||
this.target.off(View.loadedEvent, this._onTargetLoaded);
|
||||
this.target.off(View.unloadedEvent, this._onTargetUnloaded);
|
||||
this.target.off("loaded", this._onTargetLoaded);
|
||||
this.target.off("unloaded", this._onTargetUnloaded);
|
||||
|
||||
this._onTargetLoaded = null;
|
||||
this._onTargetUnloaded = null;
|
||||
|
||||
@@ -67,5 +67,3 @@ export class HtmlView extends HtmlViewBase {
|
||||
this._ios.attributedText = NSAttributedString.alloc().initWithDataOptionsDocumentAttributesError(nsData, <any>{ [NSDocumentTypeDocumentAttribute]: NSHTMLTextDocumentType }, null);
|
||||
}
|
||||
}
|
||||
|
||||
htmlProperty.register(HtmlView);
|
||||
@@ -1,5 +1,5 @@
|
||||
declare module "ui/layouts/absolute-layout" {
|
||||
import { LayoutBase, View, Property } from "ui/layouts/layout-base";
|
||||
import { LayoutBase, View, Property, Length } from "ui/layouts/layout-base";
|
||||
|
||||
/**
|
||||
* A layout that lets you specify exact locations (left/top coordinates) of its children.
|
||||
@@ -8,31 +8,31 @@
|
||||
/**
|
||||
* Gets the value of the Left property from a given View.
|
||||
*/
|
||||
static getLeft(view: View): number;
|
||||
static getLeft(view: View): Length;
|
||||
|
||||
/**
|
||||
* Sets the value of the Left property from a given View.
|
||||
*/
|
||||
static setLeft(view: View, value: number): void;
|
||||
static setLeft(view: View, value: Length): void;
|
||||
|
||||
/**
|
||||
* Gets the value of the Top property from a given View.
|
||||
*/
|
||||
static getTop(view: View): number;
|
||||
static getTop(view: View): Length;
|
||||
|
||||
/**
|
||||
* Sets the value of the Top property from a given View.
|
||||
*/
|
||||
static setTop(view: View, value: number): void;
|
||||
static setTop(view: View, value: Length): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the observable property backing the left property.
|
||||
*/
|
||||
export const leftProperty: Property<View, number>;
|
||||
export const leftProperty: Property<View, Length>;
|
||||
|
||||
/**
|
||||
* Represents the observable property backing the top property.
|
||||
*/
|
||||
export const topProperty: Property<View, number>;
|
||||
export const topProperty: Property<View, Length>;
|
||||
}
|
||||
@@ -46,6 +46,7 @@ export abstract class SegmentedBarBase extends View implements SegmentedBarDefin
|
||||
this.items = new Array<SegmentedBarItemBase>();
|
||||
}
|
||||
this.items.push(<SegmentedBarItemBase>value);
|
||||
selectedIndexProperty.coerce(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -259,9 +259,9 @@ export class SegmentedBar extends SegmentedBarBase {
|
||||
if (newItems) {
|
||||
newItems.forEach((item, i, arr) => this.insertTab(item, i));
|
||||
|
||||
if (this.selectedIndex < 0) {
|
||||
this.selectedIndex = tabHost.getCurrentTab();
|
||||
}
|
||||
// if (this.selectedIndex < 0) {
|
||||
// this.selectedIndex = tabHost.getCurrentTab();
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,9 +57,9 @@ export class SegmentedBar extends SegmentedBarBase {
|
||||
segmentedControl.insertSegmentWithTitleAtIndexAnimated(title, index, false);
|
||||
})
|
||||
|
||||
if (this.selectedIndex < 0) {
|
||||
this.selectedIndex = segmentedControl.selectedSegmentIndex;
|
||||
}
|
||||
// if (this.selectedIndex < 0) {
|
||||
// this.selectedIndex = segmentedControl.selectedSegmentIndex;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@ export class TabViewBase extends View implements TabViewDefinition, AddChildFrom
|
||||
}
|
||||
this.items.push(<TabViewItemBase>value);
|
||||
this._addView(value);
|
||||
selectedIndexProperty.coerce(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -358,11 +358,6 @@ export class TabView extends TabViewBase {
|
||||
const tv = tabLayout.getTextViewForItemAt(i);
|
||||
item.setNativeView(tv);
|
||||
});
|
||||
|
||||
let selectedIndex = this.selectedIndex;
|
||||
if (selectedIndex < 0) {
|
||||
this.selectedIndex = this._viewPager.getCurrentItem();
|
||||
}
|
||||
}
|
||||
|
||||
get [androidOffscreenTabLimitProperty.native](): number {
|
||||
|
||||
@@ -268,10 +268,6 @@ export class TabView extends TabViewBase {
|
||||
|
||||
// When we set this._ios.viewControllers, someone is clearing the moreNavigationController.delegate, so we have to reassign it each time here.
|
||||
this._ios.moreNavigationController.delegate = this._moreNavigationControllerDelegate;
|
||||
|
||||
if (this.selectedIndex < 0) {
|
||||
this.selectedIndex = this._ios.selectedIndex;
|
||||
}
|
||||
}
|
||||
|
||||
private _getIconRenderingMode(): UIImageRenderingMode {
|
||||
|
||||
Reference in New Issue
Block a user