Skip to content

Instantly share code, notes, and snippets.

View westfall's full-sized avatar

Rasmus Ring Westfall Andersen westfall

View GitHub Profile
@westfall
westfall / MultiNodeTreePickerEditor.controller.js
Created January 12, 2015 15:03
I am creating an Umbraco solution, using grid layout in v 7.2. I need some custom elements, so my thought was to use macros and Property Editors. I need to figure out how to populate my Multi Node Tree Picker from my angular controller, any help is appreciated.
angular.module("umbraco").controller("MultiNodeTreePickerEditor.controller",
function ($scope, assetsService, $http, dialogService, mediaHelper) {
$scope.model.value = [];
// fetch new items and insert them
if ($scope.model.value.length === 0) {
}
@westfall
westfall / function.php
Last active December 12, 2015 04:59
Custom Wordpress menu which has two menues one for mobile and one for dektop. Instructions: - Insert functions.php code in functions.php :) - Insert header.php in the header of your wordpress page (where you want your menus) - Toggle menus using CSS / create media queries
<?php
// creating a drop down list for mobile devices
class Walker_Nav_Menu_Dropdown extends Walker_Nav_Menu {
/* ----------
Checking wheter an item has childen, needed a little workaround, the solution can be found using this link
http://wordpress.org/support/topic/how-do-i-know-if-a-menu-item-has-children-or-is-a-leaf#post-3139633
Basicall it adds
$item->hasChildren