Skip to content

Correctly set button classname in helpers. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 9, 2014
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
4 changes: 2 additions & 2 deletions Build/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.40.0")]
[assembly: AssemblyFileVersion("1.0.40.0")]
[assembly: AssemblyVersion("1.0.41.0")]
[assembly: AssemblyFileVersion("1.0.41.0")]
7 changes: 4 additions & 3 deletions Build/publish-nuget.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# http://www.jeremyskinner.co.uk/2011/01/12/automating-nuget-package-creation-with-msbuild-and-powershell/

msbuild
$scriptpath = split-path -parent $MyInvocation.MyCommand.Path

msbuild $scriptpath/build.proj

Function Get-DropBox() {
$hostFile = Join-Path (Split-Path (Get-ItemProperty HKCU:\Software\Dropbox).InstallPath) "host.db"
Expand All @@ -10,12 +12,11 @@ Function Get-DropBox() {

$dropbox = Get-DropBox
$keyfile = "$dropbox\Personal\nuget-key.txt"
$scriptpath = split-path -parent $MyInvocation.MyCommand.Path
$nugetpath = resolve-path "$scriptpath/../.nuget/nuget.exe"
$packagespath = resolve-path "$scriptpath/packages"

if(-not (test-path $keyfile)) {
throw "Could not find the NuGet access key at $keyfile. If you're not Chris, you shouldn't be running this script!"
throw "Could not find the NuGet access key at $keyfile. If you're not the project owner, you shouldn't be running this script!"
}
else {
pushd $packagespath
Expand Down
18 changes: 12 additions & 6 deletions Griddly.Mvc/GriddlySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,33 +131,39 @@ public GriddlySettings Button(Func<object, object> argumentTemplate, string capt
if (enableOnSelection == null)
enableOnSelection = (action == GriddlyButtonAction.Ajax || action == GriddlyButtonAction.AjaxBulk || action == GriddlyButtonAction.Post);

return Add(new GriddlyButton()
var button = new GriddlyButton()
{
ArgumentTemplate = argumentTemplate,
Text = caption,
Icon = icon,
Action = action,
EnableOnSelection = enableOnSelection.Value,
ClassName = className,
Target = target
});
};

button.ClassName = ((button.ClassName ?? "") + " " + (className ?? "")).Trim();

return Add(button);
}

public GriddlySettings Button(string argument, string caption, string icon = null, GriddlyButtonAction action = GriddlyButtonAction.Navigate, bool? enableOnSelection = null, string className = null, string target = null)
{
if (enableOnSelection == null)
enableOnSelection = (action == GriddlyButtonAction.Ajax || action == GriddlyButtonAction.AjaxBulk || action == GriddlyButtonAction.Post);

return Add(new GriddlyButton()
var button = new GriddlyButton()
{
Argument = argument,
Text = caption,
Icon = icon,
Action = action,
EnableOnSelection = enableOnSelection.Value,
ClassName = className,
Target = target
});
};

button.ClassName = ((button.ClassName ?? "") + " " + (className ?? "")).Trim();

return Add(button);
}

public GriddlySettings ButtonSeparator()
Expand Down