Skip to content

Commit

Permalink
Added update button to the item UI
Browse files Browse the repository at this point in the history
  • Loading branch information
abjerner committed Nov 1, 2018
1 parent c798fbf commit ed9f40e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@
return;
}

item.loading = true;

$http.get('/umbraco/Skybrud/VideoPicker/GetVideoFromUrl?url=' + item.url).success(function (video) {

if (video.type === "youtube" && scope.config.services.youtube === false) {
Expand Down Expand Up @@ -278,8 +280,12 @@

}

item.loading = false;

}).error(function (r) {

item.loading = false;

item.type = null;
item.details = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
border: 1px dashed #d8d7d9;
padding: 10px;
margin-bottom: 10px;
position: relative;
}
.SkybrudVideoPicker .SkybrudVideoPickerItem.loading > .load-indicator {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(255, 255, 255, 0.75);
}
.SkybrudVideoPicker input[type=text] {
box-sizing: border-box;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
border: 1px dashed #d8d7d9;
padding: 10px;
margin-bottom: 10px;
position: relative;
&.loading > .load-indicator {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(255,255,255, 0.75);
}
}

input[type=text] {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<div class="SkybrudVideoPicker" ng-class="{SingleVideoPicker: config.list.limit == 1, MultiVideoPicker: config.list.limit != 1, 'umbraco-gte76': umbVersion >= 7.06}">
<div>
<div class="SkybrudVideoPickerItem videopicker-{{item.type}}" ng-repeat="item in shadowValue.items">
<div class="SkybrudVideoPickerItem videopicker-{{item.type}}" ng-repeat="item in shadowValue.items" ng-class="{loading: item.loading}">
<div style="display: flex;">
<input type="text" ng-model="item.url" ng-change="urlChanged(item)" placeholder="Enter the URL of the video here..." />
<a href="#" prevent-default class="btn btn-default" ng-click="urlChanged(item)" style="border-radius: 3px; margin-left: 10px; line-height: 18px;">
<i class="icon icon-refresh"></i>
</a>
<div class="actions" ng-if="config.list.limit != 1">
<a href="#" ng-click="removeItem($index);" prevent-default>
<i class="icon icon-delete red"></i>
Expand Down Expand Up @@ -67,6 +70,9 @@
</div>
</div>
</div>
<div class="load-indicator">
<umb-load-indicator ng-show="item.loading"></umb-load-indicator>
</div>
</div>
<div>
<a class="videopicker-add-link" href="#" prevent-default ng-click="addVideo()" ng-show="config.list.limit == 0 || config.list.limit > shadowValue.items.length">
Expand Down

0 comments on commit ed9f40e

Please sign in to comment.