Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

Resolve #162 #174

Merged
merged 3 commits into from
Jul 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion AjaxControlToolkit.Jasmine/Suites/UpdatePanelAnimationTests.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,47 @@
</Animations>
</act:UpdatePanelAnimationExtender>

<asp:DropDownList
ID="TestDropDownList"
runat="server"
AutoPostBack="True">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:DropDownList>

<asp:UpdatePanel
ID="UpdatePanelWithButton"
runat="server">
<ContentTemplate>
Content
<asp:Button runat="server" Text="Button" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="TestDropDownList" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>

<act:UpdatePanelAnimationExtender
ID="UpdatePanelWithButtonExtender"
runat="server"
TargetControlID="UpdatePanelWithButton"
AlwaysFinishOnUpdatingAnimation="true"
BehaviorID="animation2">
<Animations>
<OnUpdating>
<Parallel duration="0">
<ScriptAction Script="onUpdating();" />
</Parallel>
</OnUpdating>
<OnUpdated>
<Parallel duration="0">
<ScriptAction Script="onUpdated();" />
</Parallel>
</OnUpdated>
</Animations>
</act:UpdatePanelAnimationExtender>

<script>
function onUpdating() {
}
Expand All @@ -50,12 +91,14 @@

var BUTTON_TRIGGER_CLIENT_ID = "<%= btnTrigger.ClientID %>";
var BUTTON_NON_TRIGGER_CLIENT_ID = "<%= btnNonTrigger.ClientID %>";
var DROPDOWNLIST_CLIENT_ID = "<%= TestDropDownList.ClientID %>";
var playSpy;

describe("Postback", function() {

beforeEach(function() {
this.extender = $find("animation");
spyOn(this.extender._onUpdating.__proto__, 'play');
playSpy = spyOn(this.extender._onUpdating.__proto__, 'play');
spyOn(window, 'onUpdating');
spyOn(window, 'onUpdated');
});
Expand All @@ -74,6 +117,17 @@
$("#" + BUTTON_TRIGGER_CLIENT_ID).click();
expect(this.extender._onUpdated.__proto__.play).toHaveBeenCalled();
});

it("is updated by DropDownList", function (done) {
$("#" + DROPDOWNLIST_CLIENT_ID)
.val("2")
.trigger('change');

waitFor(
function () {
return playSpy.calls.any();
}, done);
});
});
});
</script>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AjaxControlToolkit/Scripts/UpdatePanelAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Sys.Extended.UI.Animation.UpdatePanelAnimationBehavior.prototype = {

if(!this._postBackPending) {
if(this._triggerControlsClientID.length == 0
|| this._triggerControlsClientID.indexOf(sender._activeElement.id) != -1)
|| this._triggerControlsClientID.indexOf(beginRequestEventArgs._postBackElement.id) != -1)
{
this._postBackPending = true;
this._onUpdated.quit();
Expand Down
2 changes: 1 addition & 1 deletion AjaxControlToolkit/Scripts/UpdatePanelAnimation.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.