From 9ce79e98a3dc8427503dd33f3f4ffc101ad48366 Mon Sep 17 00:00:00 2001 From: perploug Date: Wed, 29 Jan 2014 11:21:54 +0100 Subject: [PATCH] Final tweaks to TreeSource picker Better help text, polish icons and margins, made sure it toggles UI correctly for each type of tree --- .../prevalueeditors/treesource.controller.js | 7 +- .../src/views/prevalueeditors/treesource.html | 101 +++++++++++------- 2 files changed, 67 insertions(+), 41 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.controller.js index 5850225e68..c8eacd14c6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.controller.js @@ -37,10 +37,13 @@ angular.module('umbraco') }; $scope.clear = function() { - $scope.model.value.id = undefined; - $scope.node = undefined; + $scope.model.value.id = undefined; + $scope.node = undefined; + $scope.model.value.query = undefined; }; + + //we always need to ensure we dont submit anything broken $scope.$on("formSubmitting", function (ev, args) { if($scope.model.value.type === "member"){ $scope.model.value.id = -1; diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html index 8bf33770c9..8811b549b5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html @@ -1,54 +1,77 @@
- -

- -
- - -
- + +
+ + + -
- - - Available placeholders:
- $current: current page or closest found ancestor
- $parent: parent page or closest found ancestor
- $root: root of the content tree
- $site: Ancestor node at level 1
+ + + + +
    +
  • + + + Show xpath query help + + + +

    + Use Xpath query to set a root node on the tree, either based on a search from the root of the content tree, or by using a context-aware placeholder. +

    + +

    + Placeholders finds the nearest published ID and runs its query from there. so for instance: + +

    $parent/newsArticle
    + + Will try to get the parent if available, but will then fall back to the nearest ancestor and query for all news articles there. +

    + +

    + Available placeholders:
    + $current: current page or closest found ancestor
    + $parent: parent page or closest found ancestor
    + $root: root of the content tree
    + $site: Ancestor node at level 1
    +

    - - - ...Or pick a node - -
+ +
  • + + Cancel and clear query +
  • + +
    \ No newline at end of file