Skip to content

Commit

Permalink
Fixed issue with MediaFieldsEditor.ascx.cs and MediaTypeFieldsEditor.…
Browse files Browse the repository at this point in the history
…ascx.cs
  • Loading branch information
mac committed Feb 2, 2017
1 parent aa4b355 commit 792e068
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 8 deletions.
Binary file not shown.
Binary file not shown.
12 changes: 8 additions & 4 deletions WebApplication/Admin/Controls/Editors/MediaFieldsEditor.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ public void SetItems(IMediaDetail mediaDetail)
protected void Page_Init(object sender, EventArgs e)
{
BindFieldTypeDropDown(FieldTypeDropDown);
UpdateVisibility();
}

protected void Page_Load(object sender, EventArgs e)
{
Bind();
BindItemList();
}

private void Bind()
private void BindItemList()
{
ItemList.DataSource = mediaDetail.Fields.OrderBy(i => i.OrderIndex).ToList();
ItemList.DataBind();
}

private void UpdateVisibility()
{
var id = long.Parse(FieldID.Value);
var field = (MediaDetailField)BaseMapper.GetDataModel().Fields.Find(id);

Expand Down Expand Up @@ -125,7 +129,7 @@ protected void Update_Click(object sender, EventArgs e)
{
FieldID.Value = mediaField.ID.ToString();
BindVisibility(mediaField);
Bind();
BindItemList();

mediaField.MediaDetail.RemoveFromCache();
}
Expand Down Expand Up @@ -239,7 +243,7 @@ protected void Delete_Click(object sender, EventArgs e)
if (!returnObj.IsError)
{
UpdatedFieldsFromObject(new MediaDetailField());
Bind();
BindItemList();
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@ public partial class MediaTypeFieldsEditor : BaseFieldsEditor
public void SetItems(MediaType mediaType)
{
this.mediaType = mediaType;
}

protected void Page_Init(object sender, EventArgs e)
{
BindFieldTypeDropDown(FieldTypeDropDown);
}

protected void Page_Load(object sender, EventArgs e)
{
Bind();
}

private void Bind()
{
if(mediaType != null)
Expand Down
Binary file modified WebApplication/bin/FrameworkLibrary.dll
Binary file not shown.
Binary file modified WebApplication/bin/FrameworkLibrary.pdb
Binary file not shown.
Binary file modified WebApplication/bin/TinyFileManager.dll
Binary file not shown.
Binary file modified WebApplication/bin/TinyFileManager.pdb
Binary file not shown.
Binary file modified WebApplication/bin/WebApplication.dll
Binary file not shown.
Binary file modified WebApplication/bin/WebApplication.pdb
Binary file not shown.

0 comments on commit 792e068

Please sign in to comment.