-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement #161: Speedup adding new documents by autoselecting first d…
…ocument's folder
- Loading branch information
1 parent
fe19dc5
commit a69f5c6
Showing
2 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// Author: | ||
// Roman M. Yagodin <[email protected]> | ||
// | ||
// Copyright (c) 2015-2016 Roman M. Yagodin | ||
// Copyright (c) 2015-2017 Roman M. Yagodin | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
|
@@ -23,8 +23,10 @@ | |
using System.Linq; | ||
using System.Web; | ||
using System.Web.UI.WebControls; | ||
using DotNetNuke.Common; | ||
using DotNetNuke.Common.Utilities; | ||
using DotNetNuke.Entities.Modules; | ||
using DotNetNuke.Entities.Tabs; | ||
using R7.DotNetNuke.Extensions.ControlExtensions; | ||
using R7.DotNetNuke.Extensions.Utilities; | ||
using R7.University.ControlExtensions; | ||
|
@@ -125,5 +127,18 @@ protected override void OnResetForm () | |
} | ||
|
||
#endregion | ||
|
||
public override void SetData (List<DocumentInfo> items, int targetItemId) | ||
{ | ||
base.SetData (items, targetItemId); | ||
|
||
// speedup adding new documents by autoselecting first document's folder | ||
if (items.Count > 0) { | ||
var firstItem = items [0]; | ||
if (Globals.GetURLType (firstItem.Url) == TabType.File) { | ||
urlDocumentUrl.Url = firstItem.Url; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters