-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from Rhym/feature/ui-update
Updated visual style
- Loading branch information
Showing
8 changed files
with
94 additions
and
78 deletions.
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
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
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 |
---|---|---|
@@ -1,43 +1,49 @@ | ||
.cms table.ss-gridfield-table tbody td.col-Title { | ||
max-width: 100px; | ||
.cms table.grid-field__table tbody td.col-Title { | ||
max-width: 8rem; | ||
} | ||
|
||
.seo-editor-valid { | ||
background-color: #70AE6E; | ||
/** | ||
* @desc Remove the hover background color from the grid-field items, as they're distracting. | ||
*/ | ||
.cms tbody tr:hover, | ||
.cms .table tbody tr.even:hover, | ||
.cms .table tbody tr:hover { | ||
background-color: transparent; | ||
} | ||
|
||
.seo-editor-error { | ||
background-color: #F15F60; | ||
position: relative; | ||
/** | ||
* @desc Add a border, and box-shadow to the inputs in an error state. | ||
*/ | ||
.cms .seo-editor-error input, | ||
.cms .seo-editor-error input:hover, | ||
.cms .seo-editor-error input:focus, | ||
.cms .seo-editor-error textarea, | ||
.cms .seo-editor-error textarea:hover, | ||
.cms .seo-editor-error textarea:focus { | ||
border-color: #dc3545; | ||
box-shadow: 0 0 0 0.3em rgba(220, 53, 69, .5); | ||
} | ||
|
||
.seo-editor-error:hover { | ||
background-color: #f2a1a2; | ||
} | ||
|
||
|
||
.seo-editor-errors { | ||
position: absolute; | ||
bottom: 100%; | ||
font-size: smaller; | ||
margin-top: 1em; | ||
color: #dc3545; | ||
} | ||
|
||
/* Hide the messages until the parent has the appropriate class */ | ||
.seo-editor-message { | ||
display: none; | ||
position: relative; | ||
background-color: #373737; | ||
color: #FFFFFF; | ||
border: 1px solid #727272; | ||
border-radius: 10px; | ||
padding: 10px; | ||
display: none; | ||
} | ||
|
||
/* Error Message States */ | ||
.seo-editor-error-too-short:hover .seo-editor-message-too-short { | ||
display: block; | ||
.seo-editor-error-too-short .seo-editor-message-too-short { | ||
display: block; | ||
} | ||
.seo-editor-error-too-long:hover .seo-editor-message-too-long { | ||
display: block; | ||
|
||
.seo-editor-error-too-long .seo-editor-message-too-long { | ||
display: block; | ||
} | ||
.seo-editor-error-duplicate:hover .seo-editor-message-duplicate { | ||
display: block; | ||
} | ||
|
||
.seo-editor-error-duplicate .seo-editor-message-duplicate { | ||
display: block; | ||
} | ||
|
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 |
---|---|---|
@@ -1,42 +1,47 @@ | ||
(function ($) { | ||
|
||
$.entwine('ss', function ($) { | ||
|
||
$('.ss-seo-editor .ss-gridfield-item input, .ss-seo-editor .ss-gridfield-item textarea').entwine({ | ||
|
||
onchange: function () { | ||
|
||
// kill the popup for form changes | ||
$('.cms-edit-form').removeClass('changed'); | ||
|
||
var $this = $(this); | ||
var id = $this.closest('tr').attr('data-id'); | ||
var url = $this.closest('.ss-gridfield').attr('data-url') + "/update" + $this.attr('data-name') + "/" + id; | ||
var data = encodeURIComponent($this.attr('name')) + '=' + encodeURIComponent($(this).val()); | ||
|
||
// statusMessage('Saving changes', 'good'); | ||
|
||
$.post( | ||
url, | ||
data, | ||
function (data, textStatus) { | ||
// statusMessage(data.message, data.type); | ||
$this.closest('td').removeClass(); | ||
if (data.errors.length) { | ||
$this.closest('td').addClass('seo-editor-error'); | ||
data.errors.forEach(function(error) { | ||
$this.closest('td').addClass(error) | ||
}); | ||
} else { | ||
$this.closest('td').addClass('seo-editor-valid'); | ||
} | ||
|
||
}, | ||
'json' | ||
); | ||
} | ||
$.entwine('ss', function ($) { | ||
$('.ss-seo-editor .ss-gridfield-item input, .ss-seo-editor .ss-gridfield-item textarea').entwine({ | ||
|
||
onchange: function () { | ||
// kill the popup for form changes | ||
$('.cms-edit-form').removeClass('changed'); | ||
|
||
var $this = $(this); | ||
var id = $this.closest('tr').attr('data-id'); | ||
var url = $this.closest('.ss-gridfield').attr('data-url') + "/update" + $this.attr('data-name') + "/" + id; | ||
var data = encodeURIComponent($this.attr('name')) + '=' + encodeURIComponent($(this).val()); | ||
|
||
$.noticeAdd({ | ||
text: 'Saving changes', | ||
type: 'notice', | ||
stayTime: 5000, | ||
inEffect: {left: '0', opacity: 'show'}, | ||
}); | ||
|
||
$.post( | ||
url, | ||
data, | ||
function (data, textStatus) { | ||
$.noticeAdd({ | ||
text: data.message, | ||
type: data.type, | ||
stayTime: 5000, | ||
inEffect: {left: '0', opacity: 'show'}, | ||
}); | ||
|
||
$this.closest('td').removeClass(); | ||
if (data.errors.length) { | ||
$this.closest('td').addClass('seo-editor-error'); | ||
data.errors.forEach(function (error) { | ||
$this.closest('td').addClass(error) | ||
}); | ||
} else { | ||
$this.closest('td').addClass('seo-editor-valid'); | ||
} | ||
}, | ||
'json' | ||
); | ||
} | ||
}); | ||
|
||
}); | ||
}(jQuery)); |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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