Skip to content

Commit

Permalink
Fix tag label formatting, add form integration with api, add responsi…
Browse files Browse the repository at this point in the history
…ve video sizing without js
  • Loading branch information
jlukic committed Jun 25, 2014
1 parent 3cf4ca7 commit 3e99424
Show file tree
Hide file tree
Showing 6 changed files with 269 additions and 122 deletions.
29 changes: 23 additions & 6 deletions src/definitions/behaviors/form.js
Expand Up @@ -343,11 +343,27 @@ $.fn.form = function(fields, parameters) {
}
},

set: {
success: function() {
$module
.removeClass(className.error)
.addClass(className.success)
;
},
error: function() {
$module
.removeClass(className.success)
.addClass(className.error)
;
}
},

validate: {

form: function(event) {
var
allValid = true
allValid = true,
apiRequest
;
// reset errors
formErrors = [];
Expand All @@ -358,18 +374,19 @@ $.fn.form = function(fields, parameters) {
});
if(allValid) {
module.debug('Form has no validation errors, submitting');
$module
.removeClass(className.error)
.addClass(className.success)
;
module.set.error();
return $.proxy(settings.onSuccess, this)(event);
}
else {
module.debug('Form has errors');
$module.addClass(className.error);
module.set.error();
if(!settings.inline) {
module.add.errors(formErrors);
}
// prevent ajax submit
if($module.data('moduleApi') !== undefined) {
event.stopImmediatePropagation();
}
return $.proxy(settings.onFailure, this)(formErrors);
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/definitions/elements/label.less
Expand Up @@ -223,7 +223,7 @@ a.ui.label:hover:before {
.ui.tag.label:before {
position: absolute;
top: @tagTriangleTopOffset;
left: @tagTriangleLeftOffset;
right: @tagTriangleRightOffset;
content: '';

background-color: @backgroundColor;
Expand All @@ -232,7 +232,7 @@ a.ui.label:hover:before {
width: @tagTriangleSize;
height: @tagTriangleSize;

transform: rotate(45deg);
transform: translateY(-50%) translateX(50%) rotate(-45deg);
transition:
background 0.1s linear
;
Expand Down
3 changes: 2 additions & 1 deletion src/definitions/modules/modal.js
Expand Up @@ -732,7 +732,8 @@ $.fn.modal.settings = {
},
error : {
dimmer : 'UI Dimmer, a required component is not included in this page',
method : 'The method you called is not defined.'
method : 'The method you called is not defined.',
notFound : 'The element you specified could not be found'
},
className : {
active : 'active',
Expand Down

0 comments on commit 3e99424

Please sign in to comment.