remove umb-content-name
This commit is contained in:
@@ -1,92 +0,0 @@
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:umbContentName
|
||||
* @deprecated
|
||||
* We plan to remove this directive in the next major version of umbraco (8.0). The directive is not recommended to use.
|
||||
* @restrict E
|
||||
* @function
|
||||
* @description
|
||||
* Used by editors that require naming an entity. Shows a textbox/headline with a required validator within it's own form.
|
||||
**/
|
||||
|
||||
angular.module("umbraco.directives")
|
||||
.directive('umbContentName', function ($timeout, localizationService) {
|
||||
return {
|
||||
require: "ngModel",
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/directives/_obsolete/umb-content-name.html',
|
||||
|
||||
scope: {
|
||||
placeholder: '@placeholder',
|
||||
model: '=ngModel',
|
||||
ngDisabled: '='
|
||||
},
|
||||
link: function(scope, element, attrs, ngModel) {
|
||||
|
||||
var inputElement = element.find("input");
|
||||
if(scope.placeholder && scope.placeholder[0] === "@"){
|
||||
localizationService.localize(scope.placeholder.substring(1))
|
||||
.then(function(value){
|
||||
scope.placeholder = value;
|
||||
});
|
||||
}
|
||||
|
||||
var mX, mY, distance;
|
||||
|
||||
function calculateDistance(elem, mouseX, mouseY) {
|
||||
|
||||
var cx = Math.max(Math.min(mouseX, elem.offset().left + elem.width()), elem.offset().left);
|
||||
var cy = Math.max(Math.min(mouseY, elem.offset().top + elem.height()), elem.offset().top);
|
||||
return Math.sqrt((mouseX - cx) * (mouseX - cx) + (mouseY - cy) * (mouseY - cy));
|
||||
}
|
||||
|
||||
var mouseMoveDebounce = _.throttle(function (e) {
|
||||
mX = e.pageX;
|
||||
mY = e.pageY;
|
||||
// not focused and not over element
|
||||
if (!inputElement.is(":focus") && !inputElement.hasClass("ng-invalid")) {
|
||||
// on page
|
||||
if (mX >= inputElement.offset().left) {
|
||||
distance = calculateDistance(inputElement, mX, mY);
|
||||
if (distance <= 155) {
|
||||
|
||||
distance = 1 - (100 / 150 * distance / 100);
|
||||
inputElement.css("border", "1px solid rgba(175,175,175, " + distance + ")");
|
||||
inputElement.css("background-color", "rgba(255,255,255, " + distance + ")");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}, 15);
|
||||
|
||||
$(document).bind("mousemove", mouseMoveDebounce);
|
||||
|
||||
$timeout(function(){
|
||||
if(!scope.model){
|
||||
scope.goEdit();
|
||||
}
|
||||
}, 100, false);
|
||||
|
||||
scope.goEdit = function(){
|
||||
scope.editMode = true;
|
||||
|
||||
$timeout(function () {
|
||||
inputElement.focus();
|
||||
}, 100, false);
|
||||
};
|
||||
|
||||
scope.exitEdit = function(){
|
||||
if(scope.model && scope.model !== ""){
|
||||
scope.editMode = false;
|
||||
}
|
||||
};
|
||||
|
||||
//unbind doc event!
|
||||
scope.$on('$destroy', function () {
|
||||
$(document).unbind("mousemove", mouseMoveDebounce);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -496,21 +496,6 @@ input[type="checkbox"][readonly] {
|
||||
border-color: @red-l1 !important;
|
||||
}
|
||||
|
||||
//disable the glowing border for the umb-content-name
|
||||
.show-validation .umb-headline-editor-wrapper input:focus:invalid,
|
||||
.show-validation .umb-headline-editor-wrapper textarea:focus:invalid,
|
||||
.show-validation .umb-headline-editor-wrapper select:focus:invalid {
|
||||
border:none;
|
||||
color:inherit;
|
||||
border-color:inherit;
|
||||
@shadow:inherit;
|
||||
.box-shadow(@shadow);
|
||||
}
|
||||
|
||||
.ng-invalid > .umb-headline-editor-wrapper h1{
|
||||
border-bottom: 1px dashed @red; color: @red; cursor: pointer;
|
||||
};
|
||||
|
||||
// FORM ACTIONS
|
||||
// ------------
|
||||
|
||||
|
||||
@@ -80,18 +80,6 @@
|
||||
background-color: @white;
|
||||
}
|
||||
|
||||
.umb-headline-editor-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.umb-headline-editor-wrapper .help-inline {
|
||||
right: 0px;
|
||||
top: 25px;
|
||||
position: absolute;
|
||||
font-size: 10px;
|
||||
color: @red;
|
||||
}
|
||||
|
||||
.umb-panel-header p {
|
||||
margin: 0px 20px;
|
||||
}
|
||||
@@ -100,36 +88,6 @@
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.umb-headline-editor-wrapper input {
|
||||
background: none;
|
||||
border: none;
|
||||
margin: -6px 0 0 0;
|
||||
padding: 0 0 2px 0;
|
||||
border-radius: 0;
|
||||
line-height: normal;
|
||||
border: 1px solid transparent;
|
||||
color: @black;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.umb-headline-editor-wrapper input.ng-invalid {
|
||||
color: @red;
|
||||
}
|
||||
|
||||
.umb-headline-editor-wrapper input.ng-invalid::-moz-placeholder,
|
||||
.umb-headline-editor-wrapper input.ng-invalid:-ms-input-placeholder,
|
||||
.umb-headline-editor-wrapper input.ng-invalid::-webkit-input-placeholder {
|
||||
color: @red;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
/*
|
||||
.umb-panel-header i {
|
||||
font-size: 13px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
*/
|
||||
|
||||
.umb-panel-header-meta {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<ng-form name="contentNameForm">
|
||||
<div class="umb-headline-editor-wrapper" ng-class="{'ng-invalid': contentNameForm.name.$invalid}">
|
||||
|
||||
<input type="text"
|
||||
ng-disabled="ngDisabled"
|
||||
name="name"
|
||||
localize="placeholder"
|
||||
class="umb-headline"
|
||||
select-on-focus
|
||||
placeholder="{{placeholder}}"
|
||||
ng-model="model"
|
||||
required
|
||||
val-server-field="Name"/>
|
||||
|
||||
<span class="help-inline" val-msg-for="name" val-toggle-msg="required">Required</span>
|
||||
<span class="help-inline" val-msg-for="name" val-toggle-msg="valServerField">{{contentNameForm.name.errorMsg}}</span>
|
||||
|
||||
</div>
|
||||
</ng-form>
|
||||
Reference in New Issue
Block a user